Session won't pick up one variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 {

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux