简单asp注册代码

2022-07-12 08:17:15   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《简单asp注册代码》,欢迎阅读!
代码,简单,注册,asp
注册代码zhuce.asp

</word><word ps='' class=''>除尘器数据库<a href='https://www.wddqxz.cn/list-179.html' target='_blank'>管理</a></word><word class=''>

width="200" height=200 >






新用户注册
用户名




密码:



密码确认:



QQ







验证保存代码save.asp

<%

dim username,password,password2,QQ Username = Trim(Request("Username")) password = Trim(Request("password")) password2= trim(request("password2")) qq=trim(request("qq"))


for i=1 to len(username) user=mid(username,1,i)

if user="'" or user="%" or user="<" or user=">" or user="&" or user="|" then

response.write ("" ) response.end end if next

for i=1 to len(password) pass=mid(password,1,i)

if pass="'" or pass="%" or pass="<" or pass=">" or pass="&" or pass="|" then

response.write( "" ) response.end end if next

If Username = "" Or Password = "" Or Password2 = "" Then

response.write ("" ) response.End

ElseIf Password <> Password2 Then

response.write ("" ) Response.End end If

if QQ="" then

response.write ("" ) Response.End end If

set sql=server.createobject("adodb.recordset")

sql.open"select*from admin where username='"&username&"' ",conn,1,1 if sql.recordcount>0 then

response.write"用户名已经存在,请返回修改" response.end else

set sql=conn.execute("insert into [admin] ([username],[pass],[qq]) values ('"&username&"','"&pass&"','"&qq&"')")

Response.Write "




注册成功!" end if %>

连接数据库代码conn.Asp


<%

Dim Conn

Set Conn = Server.CreateObject("ADODB.Connection")

Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("db.mdb") Conn.Open %>

Access文件名为db.Mdb,里面表名为admin.Asp


本文来源:https://www.wddqxz.cn/9483957fe518964bcf847c91.html

相关推荐