Re: Problem Directing the Page with header

From: Date: Thu, 15 Feb 2007 23:18:20 +0000
Subject: Re: Problem Directing the Page with header
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248938@lists.php.net to get a copy of this message
Ashish Rizal wrote:
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. one thing to watch for is case-sensitivity. you have a logincheck.php and then a Login.php are you sure that the file has a 'L' in the name?
This is actually all mute if you are running on a windows server also. Do you know what OS is on the server? Linux, BSD, Windows, Mac... when you say "it does not seem to rediret my page"... What does it do instead??? Error...
<?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
-- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush

« previous php.general (#248938) next »