我已經完全功能的網站在我的本地主機上的wamp服務器正常工作,但我上傳相同的文件到服務器上1 & 1重定向不起作用。代碼如下URL重定向問題不重定向在服務器上
<?php require_once('../model/class.user.php'); ?>
<?php require_once('../model/class.person.php'); ?>
<?php require_once('../model/class.session.php'); ?>
<?php require_once('../model/class.loginrecord.php'); ?>
<?php require_once('../controller/general_functions.php'); ?>
<?php require_once('../controller/utility_functions.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
if(isset($_POST['checkUser'])){
$usrnme = htmlspecialchars($_POST['un']);
$paswrd = htmlspecialchars($_POST['pwd']);
if(!empty($usrnme) && !empty($paswrd)){
//verify user credentials
$foundUser = User::verify(array($usrnme, $paswrd));
if($foundUser){ //if user found in DB
//$errors[] = "Username : found<br />";
$UID = $foundUser->id;
$userRole = $foundUser->role;
$userPersonID = $foundUser->person_id;//user_person_id has stored the reference to person's table
$ip = getenv('HTTP_CLIENT_IP')?:
getenv('HTTP_X_FORWARDED_FOR')?:
getenv('HTTP_X_FORWARDED')?:
getenv('HTTP_FORWARDED_FOR')?:
getenv('HTTP_FORWARDED')?:
getenv('REMOTE_ADDR')?: "UNKNOWN";
LoginRecord::save(array(null, $foundUser->id, getCurrentDateTime(), $ip));
$findPerson = Person::findByID($userPersonID);//find the user based on the
$userFN = Person::fullName($findPerson);//find the full name of the person
$session->setValues(md5('loginStatus'), encrypt('true'));
$session->setValues(md5('userID'), encrypt($UID));
$session->setValues(md5('userFullName'), encrypt($userFN));
if($userRole == ROLE_ADCMIN)
{
$session->setValues(md5('role'), encrypt(ROLE_ADCMIN));
redirectTO('admin/dashboard.php');
}
elseif ($userRole == ROLE_AGENT)
{
$session->setValues(md5('role'), encrypt(ROLE_AGENT));
redirectTO('agent/index.php');
}
elseif ($userRole == ROLE_OTHER)
{
redirectTO('superuser/index.php');
}
} else {
$errors[] = "Sorry Username/Password not valid <br />";
}//end if($foundUser)
} else {
$errors[] = "Text fields are empty.";
}
}
重定向頁面低於功能:
function redirectTO($url = null){
if($url != null){
header("Location:{$url}");
exit();
}
}
我已經盡我所能,但它只是不工作顯示空白頁......可以請你幫我擺脫這個混亂......你有什麼想法嗎?
問候
在本地和您的服務器上運行的php版本是什麼? – 2014-08-27 16:29:53