用Dreamweaver8制作用户注册页面,要求用户名不能为空,并且确认密码一致的ASP代码!!!

用Dreamweaver8制作用户注册页面,要求用户名和密码不能为空,并且确认密码一致的ASP代码!!!
表单我已经弄好了,就是求验证用户名不能为空,并且确认密码一致的那段ASP代码,
是用ASP.NET C#做的

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<!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>
</head>
<body>
</body>
</html>

第1个回答  2013-06-28
<% If Request("action")="index.asp" Then
Call ChkLogin()
End If

Sub ChkLogin()
Dim User,Pwd,Rs,Sql
User = Trim(Request.Form("User"))
Pwd = Trim(Request.Form("Pwd"))

Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From VIP Where User='"&User&"'"
Rs.Open Sql,Conn,2,3
If ChkUserIsExist(User) = false Then
Response.Write "<Script>alert('用户名错误,请重新输入!');history.go(-1);</Script>"
Else
If trim(Rs("Pwd")) = Pwd Then
Session("User") = User
Response.Redirect "index.asp"
Else
Response.Write "<Script>alert('密码错误,请重新输入!');history.go(-1);</Script>"
End If
Rs.Close
Set Rs = nothing
End If
End Sub
%>
相似回答
大家正在搜