www.gusucode.com > ASP+ACCESS在线考试系统设计(源代码+论文) > ASP+ACCESS在线考试系统设计(源代码+论文)\郭晓璇论文第二稿\reg\add.asp
<%@ Language=VBScript %> <% name=trim(request("name")) passwd1=trim(request("pass1")) passwd2=trim(request("pass2")) if passwd1<>passwd2 then response.write "sorry,you're wrong!" response.redirect "register.asp" else mima=passwd1 end if Set conn = Server.CreateObject("ADODB.Connection") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("../试题库.mdb") set rs= server.createobject("adodb.recordset") sql="select * from 用户记录" Set base=conn.execute(sql) ii=0 do while not base.eof if name=base("用户名") then ii=1 end if base.movenext loop %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>网络考场</title> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> <meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body background="../images/1024.jpg"> <% if ii=0 then sql="insert into 用户记录(用户名,密码,权限) values ('"& name&"','"& mima &"','一般用户')" conn.execute(sql) conn.close %> <form action="register.asp" id="FORM1" method="post" name="FORM1"> <p title> </p> <table border="0" width="100%"> <tr> <th width="100%"><table border="0" width="100%"> <tr> <th width="100%"><img src="../Images/back.gif" alt="../背景.gif (87350 bytes)"></th> </tr> </table> </th> </tr> </table> <table border="0" width="100%"> <tr> <td width="100%" checked="false"> <p align="center"><font color="#00FF00" size="5"><b>添加用户成功,请返回主界面!</b></font></td> </tr> </table> <p> </p> <table border="0" width="100%"> <tr> <td width="100%" checked="false"></td> </tr> </table> <div align="center"> <center> <p title> <a href="register.asp"><input id="submit1" name="submit1" type="submit" style="font-size: large; font-style: normal; font-variant: normal; font-weight: bold; background-image: url('../Images/back.bmp'); background-repeat: no-repeat; background-position: center 50%" title value=" "></a> </p> </center></div> </form> <%else%> <form action="register.asp" id="FORM2" method="post" name="FORM2"> <p title> </p> <table border="0" width="100%"> <tr> <th width="100%"><table border="0" width="100%"> <tr> <th width="100%"><img src="../Images/back.gif" alt="../背景.gif (87350 bytes)"></th> </tr> </table> </th> </tr> </table> <table border="0" width="100%"> <tr> <td width="100%" checked="false"> <p align="center"><font color="#00FF00" size="5"><b>已有此用户,请选择其他用户名!</b></font></td> </tr> </table> <p> </p> <table border="0" width="100%"> <tr> <td width="100%" checked="false"></td> </tr> </table> <div align="center"><center><p title> <a href="register.asp"><input id="submit1" name="submit1" type="submit" style="font-size: large; font-style: normal; font-variant: normal; font-weight: bold; background-image: url('../Images/back.bmp'); background-repeat: no-repeat; background-position: center 50%" title value=" "></a></p> </center></div> </form> <%end if%> </body> </html>