11.01.2015, 17:16
use strcasecmp or just strtoupper or strtolower
strcasecmp :
strtoupper :
strtolower
Btw, $username == $dbusername is useless
strcasecmp :
pawn Code:
if($username == $dbusername && strcasecmp($pass, $dbpassword) == 0) //if username is same as one from table and if password is the same as one from table...
{
$_SESSION['username'] = $dbusername; //setting session username to one from table, this is useful if you login, that restart your browser and than you go in url where is your profile.php... Anyway this is useful :D
echo header('location: profile.php'); //redirecting user to his profile page (profile.php)
}
pawn Code:
if($username == $dbusername && strtoupper($pass) == $dbpassword) //if username is same as one from table and if password is the same as one from table...
{
$_SESSION['username'] = $dbusername; //setting session username to one from table, this is useful if you login, that restart your browser and than you go in url where is your profile.php... Anyway this is useful :D
echo header('location: profile.php'); //redirecting user to his profile page (profile.php)
}
pawn Code:
if($username == $dbusername && $pass == strtolower($dbpassword)) //if username is same as one from table and if password is the same as one from table...
{
$_SESSION['username'] = $dbusername; //setting session username to one from table, this is useful if you login, that restart your browser and than you go in url where is your profile.php... Anyway this is useful :D
echo header('location: profile.php'); //redirecting user to his profile page (profile.php)
}