Daniel Brown schreef:
On 8/24/07, Borokov Smith <borokov@xxxxxxxxx> wrote:
[snip]
A warrant about your example not being validated, will most likely not
stop the OP from using this code as is, thereby subjecting himself to
SQL injection.
And all it needed was mysql_real_escape_string() in there.
Kinda' like this part, right?
[snip]
if($_POST['user'] && $_POST['pass']) { // Keep in mind, PASSWORD
has meaning in MySQL
// Do your string sanitizing here
// (e.g. - $user = mysql_real_escape_string($_POST['user']);)
$sql = "SELECT * FROM users WHERE user='".$user."' AND
pass='".$pass."' LIMIT 0,1;";
[/snip]
Exactly what I was talking about.
Sorry dude :)
greetz,
boro
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php