Problem Directing the Page with header

From: Date: Thu, 15 Feb 2007 22:38:35 +0000
Subject: Problem Directing the Page with header
Groups: php.general 
Request: Send a blank email to php-general+get-248937@lists.php.net to get a copy of this message
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

« previous php.general (#248937) next »