Jump to content

[SOLVED] If this AND this statment - not working


nutt318

Recommended Posts

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';
}
?>

      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 

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.