新手问题。。。。!!!!!

love_365 2009-07-25 05:33:58
调用函数验证码显示不出来。请问是什么问题。。???

主页代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Conn/Conn.asp"-->
<!--#include file="../Include/function.asp"-->
<%
Session("verifycode") = randStr(6)
If Not Isempty(Request("Landing")) Then
text_name = Str_filter(Request.Form("text_name"))
text_pwd = Str_filter(Request.Form("text_pwd"))
verifycode = Str_filter(Request.Form("verifycode"))
verifycode1 = Str_filter(Request.Form("verifycode1"))
If verifycode <> verifycode1 Then
Response.Write"<script language='javascript'>alert('您输入的验证码不正确!');location.href='Landing.asp'</script>"
Response.End()
Else
Session("verifycode") = ""
End if
If Text_name<>"" Then
Set Rs = Server.CreateObject("ADODB.RecordSet")
SqlStr = "sleect * from AdminUser where Name = '"&Text_name&"'"
Rs.open SqlStr,1,1
If Rs.EOF Then
Response.Write("<script lanuage='javascrit'>alert('管理员名称不正确,请重新输入!');location.href='Landing.asp'</script>")
Else
If Rs("Pwd") <> text_pwd Then
Response.Write("<script lanuage='javascript'>alert('管理员密码不正确,请重新输入!');location.href='Landing.asp'</script>>")
Else
Session("Name") = Rs("Name")
Response.Redirect("Index.asp")
End if
End if
Else
Response.Write("<script lanuage='javascript'>alert('请输入管理员名称!');location.href='Landing.asp';</script>")
End if
End If
%>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>管理员登陆</title>
<link rel="stylesheet" href="css/css.css">
<script type="text/javascript">
<!--
function Mycheck()
{
if(document.all.text_name.value==""){
alert('请输入管理员名称!');return false;}
if(document.all.text_pwd.value==""){
alert('请输入密码!');return false;}
if(document.all.verifycode.value==""){
alert('请输入验证码!');return false;}
}
-->
</script>
</head>

<body>
<table width="550" height="200" border="0" align="center" cellpadding="0" cellspacing="0" background="images/landing2.gif">
<tr>
<td width="164" height="50"> </td>
<td width="386" height="50"> </td>
</tr>
<tr>
<td> </td>
<td height="150" align="right" valign="bottom">
<table width="332" height="123" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" action="" method="post">
<tr>
<td width="91" height="27" align="center">管理员:</td>
<td width="241" align="left"><label>
<input name="text_name" type="text" id="text_name" size="18" maxlength="50" />
</label></td>
</tr>
<tr>
<td align="center">密 码:</td>
<td align="left"><label>
<input name="text_pwd" type="password" id="text_pwd" size="19" maxlength="50" />
</label></td>
</tr>
<tr>
<td height="20" align="center">验证码:</td>
<td align="left"><label>
<input name="verifycode" id="verifycode" size="6" maxlength="4" onFocus="this.select(); " onMouseOver="this.style.background='#E1F4EE';" onMouseOut="this.style.background='#FFFFFF'" />
<span style="color: #FF0000"><%=Session("verifycode")%></span>
<input type="hidden" name="verifycode1" value="<%=Session("verifycode")%>">
</label></td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle"><label>
<input type="submit" name="Landing" id="Landing" value="提交" onclick="return Mycheck()"/>
</label>
<label>
      
<input name="reset" type="reset" id="reset" value="重置"/>
</label></td>
</tr>
</form>
</table></td>
</tr>
</table>
</body>
</html>

函数代码: <%
'---------- 定义转换字符函数 -----------
Function Str_filter(InString)
NewStr=Replace(InString,"'","''")
NewStr=Replace(NewStr,"<","<")
NewStr=Replace(NewStr,">",">")
NewStr=Replace(NewStr,"chr(60)","<")
NewStr=Replace(NewStr,"chr(37)",">")
NewStr=Replace(NewStr,"""",""")
NewStr=Replace(NewStr,";",";;")
NewStr=Replace(NewStr,"--","-")
NewStr=Replace(NewStr,"/*"," ")
NewStr=Replace(NewStr,"%"," ")
Str_filter=NewStr
End Function
'---------- 根据时间获取的字符串 -----------
Function GetOrderNo(dDate)
GetOrderNo = RIGHT("0000"+Trim(Year(dDate)),4)+RIGHT("00"+Trim(Month(dDate)),2)+RIGHT("00"+Trim(Day(dDate)),2)+RIGHT("00" + Trim(Hour(dDate)),2)+RIGHT("00"+Trim(Minute(dDate)),2)+RIGHT("00"+Trim(Second(dDate)),2)
End Function
'---------- 获取随机数函数 -----------
Function randStr(num)
strings="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
str=split(strings,",")
for i=1 to num
Randomize
str1=str(int((ubound(str))*rnd))
returnstr=returnstr&str1
next
ranStr=returnstr
End Function
%>
<script language="javascript">
//----------- 验证数字 ----------
function checkNum(Num){
var Expression=/^[1-9]+[0-9]*\d$/;
var re=new RegExp(Expression);
if(re.test(Num)==true){
return true;}
else{
return false;}
}
//----------- 验证E-mail地址 ----------
function checkEmail(email){
var Expression=/\w+([-+.']\w+)*\.\w+([-.]\w+)*/;
var re=new RegExp(Expression);
if(re.test(email)==true){
return true;}
else{
return false;}
}
//----------- 验证网址 ----------
function checkUrl(url){
var Expression=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/;
var re=new RegExp(Expression);
if(re.test(url)==true){
return true;}
else{
return false;}
}
//----------- 验证身份证号码 ----------
function checkCode(code) {
var Expression=/\d{17}[\d|X]|\d{15}/;
var re=new RegExp(Expression);
if(re.test(code)==true){
return true;}
else{
return false;}
}
</script>
...全文
66 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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