页面跳转后提示HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。

jxnuzhouguohong 2013-05-28 10:23:56
index.php跳转到chkadmin.php提示(服务器错误
网站在检索 http://localhost/shop/admin/chkadmin.php 时遇到错误。 该网站可能关闭进行维护或配置不正确。
以下是一些建议:
请稍后重新加载此网页。
HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。)

index.php代码:<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/font.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p> </p>
<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<script language="javascript">
function chkinput(form){
if(form.name.value==""){
alert("请输入用户名!");
form.name.select();
return(false);
}
if(form.pwd.value==""){
alert("请输入用户密码!");
form.pwd.select();
return(false);
}
return(true);
}
</script>
<form name="form1" method="post" action="chkadmin.php" onSubmit="return chkinput(this)">
<table width="545" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
<tr>
<td height="226" background="images/default_01.gif"> </td>
</tr>
<tr>
<td height="45" align="right" background="images/default_02.gif">
<table width="407" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="57" align="center">用户名:</td>
<td width="94" align="center"><input type="text" name="name" size="14" maxlength="20" class="inputcss"></td>
<td width="53" align="center"> 密 码:</td>
<td width="104" align="center"><input type="password" name="pwd" size="14" maxlength="20" class="inputcss"></td>
<td width="99"> 
<input name="imageField" type="image" src="images/default_07.gif" width="74" height="24" border="0"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="23" background="images/default_04.gif"></td>
</tr>
</table>
</form>
</body>
</html>



chkadmin.php代码
<?php

class chkinput
{
var $name;
var $pwd;

function chkinput($x,$y)
{
$this->name=$x;
$this->pwd=$y;
}

function checkinput()
{

include("conn/conn.php");
$sql=mysql_query("select * from tb_admin where name='".$this->name."'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
{
echo "hello";
echo "<script language='javascript'>alert('不存在此管理员!');history.back();</script>";
exit;
}
else
{
if($info[pwd]==$this->pwd){
header("location:default.php");
}
else
{
echo "<script language='javascript'>alert('密码输入错误!');history.back();</script>";
exit;
}

}
}
}


$obj=new chkinput(trim($_POST[name]),md5(trim($_POST[pwd])));

$obj->checkinput();



?>

初学PHP,请各位帮忙分析下,谢谢!
...全文
811 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jxnuzhouguohong 2013-05-29
  • 打赏
  • 举报
回复
非常感谢,已经根据提示解决了,多谢!
一起混吧 2013-05-28
  • 打赏
  • 举报
回复
打开php错误提示功能看看,php.ini 中令 display_errors=On ,改完后记得重启服务器。

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧