searls03 Posted March 17, 2012 Share Posted March 17, 2012 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'] == ";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']==";5757120050531338721=49121200000?"){ $username="yankeehill"; $password="password";} else if($_POST['logid']=="%6277202936423578^00000000^X?"){ $username="holdrege"; $password="password";} $password = md5($password); Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted March 17, 2012 Share Posted March 17, 2012 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. Quote Link to comment Share on other sites More sharing options...
searls03 Posted March 17, 2012 Author Share Posted March 17, 2012 you are correct. how do I set this up to work then? do I need html code for a ; or can I just enter the ;? this is scanning from a card, and then logging someone in. how would I do this so that they set correctoly? Quote Link to comment Share on other sites More sharing options...
SaCH Posted March 17, 2012 Share Posted March 17, 2012 Use this code to turn on error reporting. Put it at the bottom of <?php tag ini_set('error_reporting', -1); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.