zengyi584920
注册会员

UID 104987
精华
0
积分 57
帖子 41
金钱 57 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2007-12-28
状态 离线
|
关于php中session_start()函数的问题~~报错~求解决方法~
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
.JK_Btn{
BORDER-RIGHT: #002D96 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #002D96 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid XImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); BORDER-LEFT: #002D96 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #002D96 1px solid; height:22px; vertical-align:top;
}
.JK_Btn2{
BORDER-RIGHT: #7EBF4F 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7EBF4F 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid XImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#B3D997); BORDER-LEFT: #7EBF4F 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #7EBF4F 1px solid
}
.JK_Input{font-size:14px; width:168px; height:22px; color:#000000; border: 1px solid #C0ECFE; background-color:#65BFE4;}
</style>
<script>
if (top != self)top.location.href = "./";
</script>
</head>
<?php
require_once("../config.php.inc");
if($Mark!="UserLogOut")
{
session_start();
if(is_array($_SESSION["Demo_Admin"]))
{
echo "<script>location.href='index.php';</script>";
}
}
$db_test = DB::getInstance();//实例化DB类
$Mark = $_GET['Mark'];
if($Mark=="UserLogin")
{
$uChkCode = $_POST['uChkCode'];
session_start();
if($_SESSION["verifyCode"]!= $uChkCode)
{
echo "<script>alert('验证码不正确!');history.go(-1);</script>";
}
else
{
$UserLoginName = $_POST['uUserName'];
$UserLoginPWD = $_POST['uPwd'];
if($nums=$db_test->fetchAll("select ID,UserRealName,LastLoginTime,LastLoginIP from KS_AdminX where UserLoginName='".$UserLoginName."' and UserLoginPWD='".md5($UserLoginPWD)."'"))
{
$session_array["ID"] = $nums[0]["ID"];
$session_array["UserLoginName"] = $UserLoginName;
$session_array["UserRealName"] = $nums[0]["UserRealName"];
$session_array["LastLoginTime"] = $nums[0]["LastLoginTime"];
$session_array["LastLoginIP"] = $nums[0]["LastLoginIP"];
$_SESSION["Demo_Admin"] = $session_array;
// echo "<script>alert('登陆成功!');window.open('index.php','_top');</script>";
}
else
{
echo "<script>alert('用户名或者密码错误!');history.go(-1);</script>";
}
}
}
elseif($Mark=="UserLogOut")
{
$_SESSION["Demo_Admin"] = "";
unset($_SESSION["Demo_Admin"]);
}
?>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background-color:#3596C1">
<table width="1004" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/htgl_1.jpg" width="1004" height="108"></td>
</tr>
</table>
<table width="1004" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="70" valign="top"><img src="images/htgl_2.jpg" width="70" height="408"></td>
<td width="824" valign="top"><table width="824" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/htgl_3.jpg" width="824" height="34"></td>
</tr>
</table>
<table width="824" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="402" valign="top"><img src="images/htgl_5.jpg" width="402" height="191"></td>
<td width="325" valign="top"><table width="325" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/htgl_6.jpg" width="325" height="23"></td>
</tr>
</table>
<table width="325" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14" valign="top"><img src="images/htgl_8.jpg" width="14" height="151"></td>
<td width="296" valign="top"><table width="296" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/htgl_9.jpg" width="296" height="13"></td>
</tr>
<tr>
<td width="296" height="125" background="images/htgl_11.jpg">
<table width="296" border="0" cellspacing="0" cellpadding="0"> <form action="?Mark=UserLogin" method="post">
<tr>
<td width="89"><div align="center">用 户 名:</div></td>
<td width="207" height="30">
<input name="uUserName" type="text" class="JK_Input" id="uUserName" size="24" maxlength="50">
</td>
</tr>
<tr>
<td><div align="center">密 码:</div></td>
<td height="30">
<input name="uPwd" type="password" id="uPwd" size="24" maxlength="50" class="JK_Input" >
</td>
</tr>
<tr>
<td><div align="center">验 证 码:</div></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="31%"><input name="uChkCode" type="text" id="uChkCode" size="14" Class="JK_Input" title="请输入右侧的数字" style="width:50px;" maxlength="6"></td>
<td width="69%" height="25"><img src="../SystemUI/CheckCode.php" width="80" height="20" border="0" onClick="this.src=this.src;" alt="点击更换图片"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30"> </td>
<td valign="bottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="82%"> <div align="right">
<input name="Submit" type="submit" class="JK_Btn" value="登 陆">
</div></td>
<td width="18%"> </td>
</tr>
</table></td>
</tr></form>
</table>
</td>
</tr>
<tr>
<td><img src="images/htgl_12.jpg" width="296" height="13"></td>
</tr>
</table></td>
<td width="15" valign="top"><img src="images/htgl_10.jpg" width="15" height="151"></td>
</tr>
</table>
<table width="325" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/htgl_13.jpg" width="325" height="17"></td>
</tr>
</table></td>
<td width="97" valign="top"><img src="images/htgl_7.jpg" width="97" height="191"></td>
</tr>
</table>
<table width="824" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/htgl_14.jpg" width="824" height="183"></td>
</tr>
</table></td>
<td width="110" valign="top"><img src="images/htgl_4.jpg" width="110" height="408"></td>
</tr>
</table>
<table width="1004" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1004" height="104" background="images/htgl_15.jpg"><div align="center">
<table width="1004" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td height="66" valign="bottom"><div align="center">版权所有©<?php ?> 技术支持:<?php ?></div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<script>
var oInput = document.getElementById('uUserName');
oInput.focus();
</script>
</body>
</html>
报错了~~~错误在提交后。。
$uChkCode = $_POST['uChkCode'];
session_start();
这里的session_start();报错
|
|