我的php代码不工作时,我上传server.when我在localhost上运行它的工作fine..why ??php代码doesent工作时上传到服务器
<?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页当我在server.after点击登录此网页越做越服务器called.but它doesent后停留checklogin.php页面上登录页面重定向运行此。为什么这在服务器上发生?
错误日志中是否有任何内容?可能是'header already'错误... – Konsole
*服务器上发生了什么* PHP代码是否由服务器解释? (或者你在渲染的页面源中看到它?)PHP日志中是否有错误? Web服务器记录?如果您添加一些额外的调试和日志记录到代码中,它在哪里以及如何失败? – David
我为什么被投票?我甚至不能问问题? – dvirus