XAMPP服务器错误(错误500)
问题描述:
服务器遇到内部错误,无法完成您的请求。服务器超载或CGI脚本中出现错误。 如果您认为这是服务器错误,请与网站管理员联系。 错误500 本地主机 的Apache/2.4.25(Win32的)的OpenSSL/1.0.2j PHP/30年6月5日XAMPP服务器错误(错误500)
我打开日志错误,并发现问题是关于头()我有我的user.inc.php:
function getLogin($conn){
if(isset($_POST['login']))
{
$uid=$_POST['uid'];
$pwd=$_POST['pwd'];
$sql= "SELECT * FROM user WHERE uid='$uid' AND pwd ='$pwd'";
$result=$conn->query($sql);
if (mysqli_num_rows($result) == 1){
if($row = $result->fetch_assoc()){
$_SESSION['id'] = $row['id'];
header("Location : index.php?loginsuccess");
exit();
}
}
else{
}
}
}
错误日志:
[星期二10年7月25日:26:58.464402 2017] [HTTP:错误] [2380 PID:TID 1656] [客户端: :1:49602] AH02429:响应标题名称'位置'包含英寸有效字符,中止请求,推荐人:http://localhost/tgss/index.php
请帮忙。
答
更改此
header("Location : index.php?loginsuccess");
这个
header("Location: index.php?loginsuccess");
错误来自Location
和结肠(:
)之间的空间。
我测试你的header("Location : index.php?loginsuccess");
的冒号(:
)之间有空间,而且还返回Error 500
妈呀,非常感谢你。 我是新的PHP –