⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkname.asp

📁 学生在线考试系统:ASP+VBScript 本人自己精心编码
💻 ASP
字号:
<html>
<%
'连接数据库
Dim conn,dbpath
dbpath=Server.MapPath("..\..\data\exam.mdb") 
Set conn=CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.oledb.4.0; Data Source=" & dbpath
'执行SQL查询并将查询结果放置在rlist中
Dim rlist
Set rlist=Server.CreateObject("ADODB.Recordset")
Set rlist=conn.Execute("SELECT username FROM userinfo WHERE username='"&Request.Form("username")&_
"'")
If not rlist.EOF  then %>

<head>
<title>检查姓名</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../../css/forum.css" rel=stylesheet type=text/css>
<SCRIPT language=JavaScript>
function check(form){
if(document.form1.username.value=="") {alert("请填写正确的用户名!\n (用户名不能为空)"); document.form1.username.select();return false;}
return true;
}
</SCRIPT>
</head>

<body bgcolor="#Ffffff" text="#000000" leftmargin="5" topmargin="3" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../image/xwdt1.gif','../../image/jccs1.gif','../../image/khfw1.gif','../../image/ywlx1.gif','../../image/gsjs1.gif','../../image/jjfa1.gif','../../image/gcsl1.gif','../../image/glyw1.gif','../../image/qyyj1.gif','../../image/gllt1.gif','../../image/sy1.gif')">
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td height="15">&nbsp;</td>
  </tr>
  <tr> 
    <td height="55"> 
      <div align="center"><img src="1.gif" width="220" height="55"></div>
    </td>
  </tr>
  <tr> 
    <td height="80" valign="bottom"> 
      <div align="center"> 
        <form name="form1" method="post" action="checkname.asp" onSubmit="return check(this.form);">
          <div align="left"><font color="#336699">  </font>请输入用户名: 
            <input type="text" name="username">
            &nbsp;&nbsp;&nbsp; 
            <input type="submit" name="submit" value="确定">
          </div>
        </form>
      </div>
    </td>
  </tr>
  <tr> 
    <td><font color="#336699">  合法的用户名应该是<font 
                        color=#0066ff>0-9,a-z,A-Z</font> 之间的英文或者数字以及下划线组成,也可以使用用汉字或者其他符号申请。举例:<font color="#0066ff">alan,刘年</font></font></td>
  </tr>
  <tr> 
    <td height="50">&nbsp;&nbsp;&nbsp; 
      <%Response.Write("<font color=red>警告:用户名 <b>"&Request.Form("username")&" </b>已经存在,请更换用户名重新注册!</font>")%>
    </td>
  </tr>
</table>
</body>
<%Else %>
<%
Response.Write("<meta http-equiv='refresh' content='1; url=reg2.asp?username=" & Request.Form("username") & "'>")

end if
%>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -