List:General Discussion« Previous MessageNext Message »
From:Steve Date:June 21 2002 3:40pm
Subject:RE: Referring Page in PHP/SQL
View as plain text  
This question is more appropriate for the PHP list. 

Here is an example:

	// if row exists - login/pass is correct
	if (mysql_num_rows($result) == 1)
	{
	// initiate a session
	session_start();
	
	// register the user's ID and permission level
	list($uid, $uperms) = mysql_fetch_row($result);
	$_SESSION{UID} = '$uid';
	$_SESSION{UPERMS} = '$uperms';

	// redirect to main menu page
	header("Location:menu.php");
	mysql_free_result ($result);	

	// close connection
	mysql_close($connection);
	}
	else
	// login/pass check failed
	{
	mysql_free_result ($result);	
	mysql_close($connection);
	// redirect to error page
	header("Location: error.php?e=0");
	exit;
	}

-Steve


Thread
Referring Page in PHP/SQLTokunboh Oladejo21 Jun
  • RE: Referring Page in PHP/SQLSteve21 Jun
  • RE: Referring Page in PHP/SQLPeter Lovatt22 Jun