username = request("username")
if isNull(username) then
username = ""
else
username = Trim(username)
end if
sql="select * from 用户表 where 姓名='"&username&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
If rs.BOF And rs.EOF Then
rs.addnew
rs("姓名")=username
rs.update
rs.close
set rs=Nothing
response.write "<script language=javascript>"
response.write " alert('添加信息成功!')"
response.write " window.location='你想返回的页面.asp'"
response.write "</script>"
Else
rs("姓名")=username
rs.update
rs.close
set rs=Nothing
response.write "<script language=javascript>"
response.write " alert('信息修改成功')"
response.write " window.location='你返回的页面地址.asp'"
response.write "</script>"
End If
<%dim conn,connstr,sql,RS,username
username=Reauest.Form("username")
set conn=server.CreateObject("adodb.connection")
dbpath=server.mappath("data/db.mdb")
connstr="provider=microsoft.jet.oledb.4.0data source="&dbpath
conn.open connstr
set Rs=server.CreateObject("adodb.recordset")
sql="select * from zhuce where username='"&username&"'"
Rs.open sql,conn,1,3
if RS.eof then
Rs.addnew
Rs("username")=request.Form("username")
Rs("sex")=request.Form("sex")
Rs("pwd")=request.Form("pwd")
Rs("company")=request.Form("company")
Rs("postalcode")=request.Form("postalcode")
Rs("telephone")=request.Form("telephone")
Rs("fax")=request.Form("fax")
Rs("email")=request.Form("email")
Rs.update
Rs.Close
conn.close
Set Rs=nothing
set conn=nothing
response.Write("恭喜您注册成功 请现在去登陆吧")
else
end if
%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)