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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.