Jump to content

[SOLVED] Login Twice


timmah1

Recommended Posts

Does anybody have any idea why this makes everyone log in twice?

 

I have a login form at the top of my pages, on the header, and it directs to login.php, which is this, to verify.

But it always makes you login twice

 

if($_POST['login'])
{
session_start();
require("config.php");

$loginsql = "SELECT * FROM memSales WHERE email = '" . $_POST['email'] . "' AND password = '" . $_POST['password'] . "'";
$loginres = mysql_query($loginsql);
$numrows = mysql_num_rows($loginres);


	if($numrows == 1){				
			$loginrow = mysql_fetch_assoc($loginres);

					$_SESSION['SESS_LOGGEDIN'] = 1;
					$_SESSION['SESS_NAME'] = $loginrow['name'];
					$_SESSION['SESS_EMAIL'] = $loginrow['email'];
					$_SESSION['SESS_PASS'] = $loginrow['password'];

					header("Location: " . $config_basedir . "members/");

				}	

				else {	
				header("Location: " . $config_basedir . "login.php?error=2");

				}

	}

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/138041-solved-login-twice/
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.