问题还真多 页面语言声明错误出现中文标点
关键字 document 拼写错误sql 引号位置错误
觉得有用就加点分吧 不要老是发蛋贴了 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE6 {
font-size: 36px;
font-style: italic;
color: #FF0000;
}
-->
</style>
<script language="javascript">
function check()
{
if(document.form1.student.value=="")
{alert("请输入用户名");
document.form1.student.focus();
return false;}
if(document.form1.pwd.value=="")
{alert("请输入用户密码");
document.form1.pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
} </script>
<% session.timeout=125
if trim(request("ctype"))="add" then
session("student")=""
session("classes")=""
session("id")=""
session("number")=""
session("sex")=""
sql="select * from student where studentname='"&trim(request("student"))&"' and studentpassword='"&trim(request("pwd"))&"' "
set rs=conn.execute(sql)
if rs.eof then
%>
<script language="javascript">
alert("无此学员!请先注册");
</script>
<%
else
session("student")=rs("studentname")
session("classes")=rs("class")
session("number")=rs("studentnumber")
session("sex")=rs("sex")
session("timen")=now
%>
<script language=javascript>
var now=new Date()
window.navigate("index.asp?time="+now.getTime());
</script>
<%
end if
end if%>
</head> <body>
<table align="center" width="758" height="152" border="0">
<tr>
<td width="736" height="100%" bgcolor="#33FF33"> <div align="center" class="STYLE6">在线考试系统 </div> </td>
</tr>
</table> <table width="734" border="0" align="center" cellpadding="4" bordercolor="#1111111" style="border-collapse:collapse; position:absolute; left: 258px; top: 182px;">
<tr>
<td height="249"> <form id="form1" name="form1" method="post" action="">
<input type="hidden" name="ctype" />
<table width="745" border="0" height="247">
<tr>
<td width="8"> </td>
<td width="359"> <table width="100%" border="0" style="border-collapse:collapse" bordercolor="#111111" cellpadding="5" cellspacing="0" >
<tr>
<td width="21%"> <div align="center">用户名 </div> </td>
<td colspan="2"> <label>
<input type="text" name="student" />
</label> </td>
<td width="18%"> </td>
</tr>
<tr>
<td> <div align="center">密码 </div> </td>
<td colspan="2"> <label>
<input type="text" name="pwd" />
</label> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td width="23%"> <label>
<input type="button" onclick="check()" name="Submit" value="提交" >
</label> </td>
<td width="38%"> <label>
<input type="submit" name="Submit2" value="重置" />
</label> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <a href="register.asp" >新学生注册 </a> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <p> <a href="admin/index.asp">后台管理程序入 </a> </p> </td>
<td> </td>
</tr>
</table>
<p> </p> </td>
<td width="356"> <p> </p>
<p align="center"> <img src="gif/晚霞.jpg" width="139" height="104" /> </p> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
关键字 document 拼写错误sql 引号位置错误
觉得有用就加点分吧 不要老是发蛋贴了 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE6 {
font-size: 36px;
font-style: italic;
color: #FF0000;
}
-->
</style>
<script language="javascript">
function check()
{
if(document.form1.student.value=="")
{alert("请输入用户名");
document.form1.student.focus();
return false;}
if(document.form1.pwd.value=="")
{alert("请输入用户密码");
document.form1.pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
} </script>
<% session.timeout=125
if trim(request("ctype"))="add" then
session("student")=""
session("classes")=""
session("id")=""
session("number")=""
session("sex")=""
sql="select * from student where studentname='"&trim(request("student"))&"' and studentpassword='"&trim(request("pwd"))&"' "
set rs=conn.execute(sql)
if rs.eof then
%>
<script language="javascript">
alert("无此学员!请先注册");
</script>
<%
else
session("student")=rs("studentname")
session("classes")=rs("class")
session("number")=rs("studentnumber")
session("sex")=rs("sex")
session("timen")=now
%>
<script language=javascript>
var now=new Date()
window.navigate("index.asp?time="+now.getTime());
</script>
<%
end if
end if%>
</head> <body>
<table align="center" width="758" height="152" border="0">
<tr>
<td width="736" height="100%" bgcolor="#33FF33"> <div align="center" class="STYLE6">在线考试系统 </div> </td>
</tr>
</table> <table width="734" border="0" align="center" cellpadding="4" bordercolor="#1111111" style="border-collapse:collapse; position:absolute; left: 258px; top: 182px;">
<tr>
<td height="249"> <form id="form1" name="form1" method="post" action="">
<input type="hidden" name="ctype" />
<table width="745" border="0" height="247">
<tr>
<td width="8"> </td>
<td width="359"> <table width="100%" border="0" style="border-collapse:collapse" bordercolor="#111111" cellpadding="5" cellspacing="0" >
<tr>
<td width="21%"> <div align="center">用户名 </div> </td>
<td colspan="2"> <label>
<input type="text" name="student" />
</label> </td>
<td width="18%"> </td>
</tr>
<tr>
<td> <div align="center">密码 </div> </td>
<td colspan="2"> <label>
<input type="text" name="pwd" />
</label> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td width="23%"> <label>
<input type="button" onclick="check()" name="Submit" value="提交" >
</label> </td>
<td width="38%"> <label>
<input type="submit" name="Submit2" value="重置" />
</label> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <a href="register.asp" >新学生注册 </a> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <p> <a href="admin/index.asp">后台管理程序入 </a> </p> </td>
<td> </td>
</tr>
</table>
<p> </p> </td>
<td width="356"> <p> </p>
<p align="center"> <img src="gif/晚霞.jpg" width="139" height="104" /> </p> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
解决方案 »
- AJAX返回status的值经常是-1
- 关于js限制的问题
- 不等于某个东西的正则怎么写
- JS时间显示问题
- javascript如何同步调用webservice?
- 导航栏的下拉菜单在IE6.0的版本可以正常显示,换到IE7.0的版本无法显示。
- 高手在哪里啊?
- 如何让页面在完全下载后,JS才给一个变量赋值??
- 带复选框的树形菜单!!!急急!!
- 救急:谁有与http://www.burnons.com/1000的菜单一个样式的源代码,要有良好注解的。谢谢!
- 用for循环生成多个checkbox但是name都一样,这样如何去实现选择一个复选框就显示一个testarea取消一个复选框就不显示刚才的testarea
- 如何做出点击图片,图片居中,其他部分阴影显示
if trim(request("ctype"))="add" then
session("student")=""
session("classes")=""
session("id")=""
session("number")=""
session("sex")=""
sql="select * from student where studentname=' "&trim(request("student"))&' " and studentpassword=' "&trim(request("pwd"))&" ' "
set rs=conn.execute(sql)
if rs.eof then
%>
<script language="javascript">
alert("无此学员!请先注册");
</script>
<%
else
session("student")=rs("studentname")
session("classes")=rs("class")
session("number")=rs("studentnumber")
session("sex")=rs("sex")
session("timen")=now
%>
<script language=javascript>
var now=new Date()
window.navigate("index.asp?time="+now.getTime());
</script>
这段代码有问题,放进去了就不能正确提示信息
另外你的密码验证的代码地方有问题:
if(docuemnt.form1.pwd.value=="") //拼写错误
{alert("请输入用户密码");//应该是英文状态下的;
document.form1.pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
}