Jump to content

not setting


searls03

Recommended Posts

can anyone tell me why $username is not setting properly?  the password is, but $username is no.  it is setting as blank:

if ($_POST['go']) {
//Connect to the database through our include
if ($_POST['logid'] ==  "&#59;5757120050531338739=49121200000?"){
$username="oldcheney";
$username = stripslashes($username);
$username = strip_tags($username);
$username= strtolower($username);
$username = mysql_real_escape_string($username);

$password="password";}
else if($_POST['logid']=="&#59;5757120050531338721=49121200000?"){
$username="yankeehill";
$password="password";}
else if($_POST['logid']=="%6277202936423578^00000000^X?"){
$username="holdrege";
$password="password";}

$password = md5($password);

Link to comment
https://forums.phpfreaks.com/topic/259105-not-setting/
Share on other sites

my guess is that none of the conditions are being met, so $username never gets declared.

However, since you have $password = md5($password); out of any conditional block, even if none of the conditions are met, $password will still be set to d41d8cd98f00b204e9800998ecf8427e which is the md5 hash of an empty string.

You should be receiving an "undefined variable" error with this, if you have error_reporting set correctly.

Link to comment
https://forums.phpfreaks.com/topic/259105-not-setting/#findComment-1328335
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.