If you're using something like MySQLi
Something like this usually works for me...Code:if (get_magic_quotes_gpc()) { $Username = stripslashes($Username ); $Password = stripslashes($Password); } $Username = mysqli_real_escape_string($dbi, $Username); $PasswordHash = md5($Password); $SQL = "SELECT * FROM `Users` WHERE `Username` = '$Username' LIMIT 1";
First bit removes any "automatic" security features.
Second bit adds new security bits.
MD5 will removed any SQL injection code through it's encoding.
If it's just a number, put $i = (int)$_GET['FormNumber'];
This will make sure it can only have a number.
asd = 0
123asd = 123
asd123 = 0
like that, then just test that dad, but... injection safe...


Reply With Quote
