当我在服务器上上传时,我的 php 代码不起作用。当我在 localhost 上运行它时,它工作正常..为什么?
<?php
ob_start();
include 'CUserDB.php';
session_start();
include 'config.php';
$myusername=$_POST['txtusername'];
$mypassword=$_POST['txtpassword'];
$typ= $_POST['type'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$typ = stripslashes($typ);
$myusername = mysql_real_escape_string($myusername);
$mypassword=mysql_real_escape_string($mypassword);
$typ = mysql_real_escape_string($typ);
try {
$oUser = new CUserDB();
$result = $oUser->Login($myusername,$mypassword,$typ);
}
catch (PDOException $pe)
{
die("Error occurred:" . $pe->getMessage());
}
if($result[0][0][UserName] != '')
{
session_start();
$_SESSION['UserId'] = $myusername;
if( $typ == "Dealer")
{
header('location:Dealer/ManageProfile.php');
}
else if ($typ == "Individual")
{
header('location:Individual/managep.php');
}
else
{
header('location:Builder/managep.php');
}
}
else
{
header('location:header.php');
}
?>
当我在服务器上运行此页面时,这是检查登录页面。单击登录后,此页面被调用。但在服务器上,登录页面后它不会重定向,它停留在 checklogin.php 页面上。为什么这会发生在服务器上?