Re: Session won't pick up one variable

From: Date: Fri, 30 Jan 2009 23:20:30 +0000
Subject: Re: Session won't pick up one variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-287462@lists.php.net to get a copy of this message
You can set it where you are attempting to, but you need to have the sesion_start(); at the top of the file Bastien Sent from my iPod On Jan 30, 2009, at 17:20, Terion Miller <webdev.terion@gmail.com> wrote:
Think I'm setting this in the wrong place...someone help ...where do I set the AdminID session if (isset($_POST['UserName'])) {$UserName = $_POST['UserName'];} else {$UserName = '';} if (isset($_POST['Password'])) {$Password = $_POST['Password'];} else {$Password = '';} $msg = ''; if (!empty($UserName)) { $sql = "SELECT AdminID,UserName FROM admin WHERE
UserName='$UserName' and    Password='$Password'";
$result = mysql_query ($sql); $row = mysql_fetch_object ($result); if (isset($_POST['AdminID'])) {$AdminID = $_POST['AdminID'];} else {$AdminID= '';} If (mysql_num_rows($result) > 0) {
       $_SESSION['AdminLogin'] = true;
       $_SESSION['user']=$UserName;
       $_SESSION['AdminID']=$AdminID;
       header ('Location: Main.php');
       exit;
} else {


« previous php.general (#287462) next »