Problem Directing the Page with header

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

 



Hi, I am having problem with redirecting the page in user
authenication page . I am working on my windows machine as a
localhost with PHP Version 5.2.0. Everything is working good in
local machine (in Windows) but now when i tried to upload the
same code to the server which is using PHP Version 5.1.6, it does
not seem to redirect my page. I have a main loginpage which on
post goes to the logincheck.php and in Login.php i have all the
stuffs to authenticate and redirect the user. I am pasting the
logincheck.php code below. 

<?php
session_start();
require_once 'functions.php';
$UserName = $_POST['UserName'];
$Password = $_POST['Password'];
$error = login_check($_POST);
$adminAddress = getAbsolutePath().'adminlogin.php';
$userAddress = getAbsolutePath().'userlogin.php';
$samePage = getAbsolutePath().'login-new.php';
if (trim ($error)=="")
{
$accesslevel = accessLevel($UserName);
if ($accesslevel == "admin"){
$_SESSION["userid"] = login($_POST);
header("Location: $adminAddress");
exit();
}
else if ($accesslevel == "user"){
$_SESSION["userid"] = login($_POST);
header("Location: $userAddress");
exit();
}
}
else {
$errorMessage = '$error';
header("Location: $samePage");
exit();
}
?>

Any Help would be highly aprriciated.
Thanks a lot 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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