找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 105|回复: 1

各位帮我看看

[复制链接]
发表于 2010-1-18 09:21:06 | 显示全部楼层 |阅读模式 IP:江苏扬州
LOGIN.ASP 的代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登陆</title>
<script language="javascript">
<!--
function validateLogin()
{
if (document.frmlogin.txtUserName.value==""){
alert("请输入用户名")
document.frmlogin.txtUserName.focus()
return false
}
if (document.frmlogin.txtPassword.value==""){
alert("请输入密码")
document.frmlogin.txtPassword.focus()
return false
}
if (document.frmlogin.txtUserName.value.indexOf("'") !=-1){
alert("用户名中不能包含撇号!")
document.frmlogin.txtUserName.focus()
return false
}
if (document.frmlogin.txtPassword.value.indexOf("'") !=-1){
alert("密码中不能包含撇号!")
document.frmlogin.txtPassword.focus()
return false
}
}
-->
</script>
</head>
<style type="text/css">
<!--
.style2 {
font-size: 18px;
color: #006666;
}
.style3 {color: #006666}
-->
</style>
<body>
<form name="frmlogin" method="post" action="verifyID.asp" onSubmit="return validateLogin()">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006666">
<tr>
<th align="center" valign="middle" bgcolor="#FFFFFF" scope="col"><p>&nbsp;</p>
<p><span class="style2">登陆界面</span>&nbsp;&nbsp;</p>
<p><span class="style3">用户名:</span>
<input name="txtUserName" type="text" id="txtUserName" size="20" maxlength="20" value="">
</p>
<p><span class="style3">密&nbsp;&nbsp;码:</span>
<input name="txtPassword" type="password" id="txtPassword" size="20" maxlength="20" value="">
</p>
<p>
<input type="submit" name="xsubmit" value="提交">
&nbsp;&nbsp;
<input name="xreset" type="reset" value="重置">
</p>
<p>&nbsp;</p></th>
</tr>
</table>
</form>
</body>
</html>

verifyID.asp 的代码
<!--#include file="GeneralTool.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登陆</title>
</head>
<body>
<div align=center>
<%
dim strUserName
dim strPassword
strUserName=request.form("txtUserName")
strPassword=request.form("txtPassword")
call tackleEmpty(strUserName)
call tackleEmpty(strPasswrod)
call tacklePrime(strUserName)
call tacklePrime(strPassword)
call tackleOverLen(strUserName,15)
call tackleOverLen(strPassword,15)
call openDB()
sql="select * form UserInfo where (USER_NAME='"&strUserName&"' "&" and Password='"&Password&"')"
set rs=conn.Execute(sql)
if not rs.eof then
session("UserName")=strUserName
call showMsg("登陆成功!")
else
call showMsge("你还没有注册呢!请点击下面开始注册:)")
end if
call closeDB()
%>
</div>
</body>
</html>

GeneralTool.asp的代码
<%
dim sql,conn,rs,webURL
webURL="http://"&Request.ServerVariables("SERVER_NAME")&"/"
'简单的出错处理(任何暴露给客户得错误信息都是不可以原谅得!)
on error resume next
'打开数据库连接
sub openDB()
set conn=Server.CreateObject("ADODB.Connection")
conn.open"PROVIDER=SQLOLEDB; " & " DATASOURCE=TOMMAO; " & " DATABASE=mydata; " & " UID=sa;PWD=123"
set rs=Server.CreateObject("ADODB.Recordset")
end sub
'关闭数据库
sub closeDB()
if ISObject(conn) then
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
end sub
'处理空字符窜
sub tackleEmpty(strItem)
strItem = trim(strItem)
if strItem = "" then
call closeDB()
response.redirect webURL
end if
end sub
'处理撇号
sub tacklePrime(strItem)
if instr(strItem,"'")<>0 then
call closeDB()
response.redirect webURL
end if
end sub
'处理长度问题
sub tackleOverLen(strItem,intLen)
if len(strItem)>intlen then
call closeDB()
response.redirect webURL
end if
end sub
'显示信息
sub showMsg(strItem)
response.Write("<font size=5 color=geen>strItem</font>")
end sub
sub showMsge(strItem)
response.Write("<br><font size=5 color=green>strItem</font><br><br><a href=xxxx.ASP><font size=5 color=green>注册</font></a>")
end sub
%>

我现在的问题是用LOGIN.ASP提交登陆信息时,提交不了,各位高手帮我看看。
谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 17:22 , Processed in 0.274065 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表