MySQL-4.x.x and md5 password?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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}");
}
}
}


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux