nutt318 Posted February 12, 2009 Share Posted February 12, 2009 I want to make sure that the password and email field are Equal To the stored info. For some reason I can enter in just the password and it works. It seems to skip the Equal To for the email Also, my code doesnt work with '==' but works with '<>', is there a reason for that? Thanks for your help. <? } /* END FUNCTIONS */ $errormsg=''; if (substr($_SERVER['REQUEST_URI'],-7)!='control.php') {// if someone tries to request sas.php if (isset($_POST['sub'])) { // if form has been submitted $submitted_pass=md5($_POST['password']); // encrypt submitted password $submitted_email=($_POST['email']); //if ($submitted_email<>$encrypt_email) if ($submitted_pass <> $encrypt_pass && $submitted_email <> $encrypt_email) { // if password is incorrect $errormsg=$msg; show_login_page($errormsg); exit(); } else { // if password is correct setmycookie(); } } else { if (isset($_COOKIE[$cookiename])) { // if cookie isset if ($_COOKIE[$cookiename]==$encrypt_pass) { // if cookie is correct // do nothing } else { // if cookie is incorrect show_login_page($errormsg); exit(); } } else { // if cookie is not set show_login_page($errormsg); exit(); } } } else { echo 'Try requesting control.php'; } ?> Link to comment https://forums.phpfreaks.com/topic/144914-solved-if-this-and-this-statment-not-working/ Share on other sites More sharing options...
rhodesa Posted February 12, 2009 Share Posted February 12, 2009 if ($submitted_pass <> $encrypt_pass && $submitted_email <> $encrypt_email) { // if password is incorrect should probably be: if ($submitted_pass != $encrypt_pass || $submitted_email != $encrypt_email) { // if password is incorrect Link to comment https://forums.phpfreaks.com/topic/144914-solved-if-this-and-this-statment-not-working/#findComment-760441 Share on other sites More sharing options...
nutt318 Posted February 12, 2009 Author Share Posted February 12, 2009 rhodesa, Thanks for the help help. It was the '||' that fixed it. Thanks Link to comment https://forums.phpfreaks.com/topic/144914-solved-if-this-and-this-statment-not-working/#findComment-760469 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.