MySQL-4.x.x and md5 password?

From: Date: Tue, 24 Feb 2004 04:10:24 +0000
Subject: MySQL-4.x.x and md5 password?
Groups: php.db 
Request: Send a blank email to php-db+get-33093@lists.php.net to get a copy of this message
Howdy -- The following code bite, works with MySQL-2.x.x but not with MySQL4.x.x. Any suggestions. One other note, I'm using the DBal (database layer) from phpBB forum. TIA, David --------- login.php --------- if ( $_SERVER['QUERY_STRING'] == 'logout' ) { setcookie('lb_user', NULL, time(), str_replace(basename($_SERVER['REQUEST_URI']), '', $_SERVER['REQUEST_URI']), $_SERVER['HTTP_HOST']); setcookie('lb_pass', NULL, time(), str_replace(basename($_SERVER['REQUEST_URI']), '', $_SERVER['REQUEST_URI']), $_SERVER['HTTP_HOST']); header("Location: index.{$phpEx}"); } if ( !empty($_POST['uname']) && !empty($_POST['pword']) ) { $sql = "SELECT user_pass FROM {$db->prefix}users WHERE user_name='$_POST[uname]';"; $query = $db->sql_query($sql); $result = $db->sql_fetchrowset($query); if ( count($result) ==1 ) { if ( md5($_POST['pword']) == $result[0]['user_pass'] ) { setcookie('lb_user', $_POST['uname'], NULL, str_replace(basename($_SERVER['REQUEST_URI']), '', $_SERVER['REQUEST_URI']), $_SERVER['HTTP_HOST']); setcookie('lb_pass', md5($_POST['pword']), NULL, str_replace(basename($_SERVER['REQUEST_URI']), '', $_SERVER['REQUEST_URI']), $_SERVER['HTTP_HOST']); header("Location: index.{$phpEx}"); } } }

« previous php.db (#33093) next »