note 68655 added to function.mysql-real-escape-string
| From: | tomfmason at spammerssuck dot com | Date: | Sat, 05 Aug 2006 11:36:33 +0000 |
| Subject: | note 68655 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115566@lists.php.net to get a copy of this message | ||
<?php
include ('includes/db.php');
array_pop($_POST);
if ( get_magic_quotes_gpc() ) {
$_POST= array_map('stripslashes', $_POST);
}
$username= mysql_real_escape_string(trim($_POST['username']));
$password= mysql_real_escape_string(trim($_POST['password']));
$mdpwd= md5($password);
$sql= sprintf("SELECT COUNT(*) AS login_match FROM
users WHERE
username = '%s' AND password= '%s'", $username,
$mdpwd);
$res= mysql_query($sql) or die(mysql_error());
$login_match= mysql_result($res, 0, 'login_match');
if ( $login_match == 1 ) {
//logged in
} else {
// not logged in
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 68.99.113.17
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/68655
Del: integrated -- https://master.php.net/note/delete/68655/integrated
Del: useless -- https://master.php.net/note/delete/68655/useless
Del: bad code -- https://master.php.net/note/delete/68655/bad+code
Del: spam -- https://master.php.net/note/delete/68655/spam
Del: non-english -- https://master.php.net/note/delete/68655/non-english
Del: in docs -- https://master.php.net/note/delete/68655/in+docs
Del: other reasons-- https://master.php.net/note/delete/68655
Reject -- https://master.php.net/note/reject/68655
Search -- https://master.php.net/manage/user-notes.php