Why not have the DB connection code in it's own file? Saves on space (:
|
PHP
Registration script. |
(Apr 22, 2014 05:59 PM)So... Wrote: If we are being picky, the username is vulnerable to xss injection, try inputting a username like1 use htmlspecialchars() not htmlentities() 2: remove unwanted chars rather than use the vulnerable strip_tags() >"<script>alert(1)<script><" should bypass strip_tags()... Sample: Only allow letters, numbers and underscores. if (!preg_match('/^[a-z0-9_]*$/UD',$_POST[username])){ # We're not ok, do not allow this username ! } (Apr 23, 2014 04:07 AM)VipVince Wrote: Thanks for the feed back guys. So overall its quite secure?It's good but you should add LIMIT 1 to the query checking if the user exist and for logging in. |
|
|
