Jump to content

Why can't I have more then one user


xxreenaxx1

Recommended Posts

My problem has been moved on from that to getting a blank page. PHP is just killing my life

 

<?PHP

$connect = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("Examination") or die(mysql_error());

if ($_POST['submit'])
{
//get data
$username= $_POST['user'];
$password =$_POST['pass'];

	if ($username && $password)
	{

	$query = mysql_query("SELECT * FROM user");
	while($getrows =mysql_fetch_assoc($query))
	{
		$dbuser = $getrows['user'];
		$dbpass = $getrows['pass'];

	}

		if (($username == $dbuser)  &&($password == $dbpass))
	{

		echo "welcome" . $_COOKIE['username'] . "whoever";
		$_SESSION['username'] = $username;

	}

		else
		{
			echo"failed";
		}
	}
	else
	{
		die("Field not empty");
	}
}
?>

 

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.