【发布时间】:2017-12-30 18:36:03
【问题描述】:
服务器遇到内部错误,无法完成您的请求。服务器过载或 CGI 脚本中存在错误。 如果您认为这是服务器错误,请联系网站管理员。 错误 500 本地主机 Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
我打开日志错误发现问题出在我的 user.inc.php 中的 header() 上:
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{
}
}
}
错误日志:
[2017 年 7 月 25 日星期二 10:26:58.464402] [http:error] [pid 2380:tid 1656] [client ::1:49602] AH02429:响应标头名称“Location”包含无效字符、中止请求、引用:http://localhost/tgss/index.php
请帮忙。
【问题讨论】:
标签: php html mysql apache xampp