www.gusucode.com > ASP毕业设计在线考试管理系统源码 > ASP毕业设计在线考试管理系统源码\code\yhzc.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="db.asp"-->
<%
If request("Submit")<>"" Then
    Dim Sql, Rs
    Set rs = server.CreateObject("adodb.recordset")
        Sql = "select * from User_info where UserName='" &request("name")&"'"
        rs.Open Sql, conn, 1, 3
    If Not rs.EOF Then
        response.Write "<script language=JavaScript>alert('用户已经存在');window.location.href='default.asp';</script>"
        rs.Close
        Set rs = Nothing
        response.End
    Else
        rs.AddNew
        rs("UserName") = request("name")
        rs("Pwd") = request("pass")
        'rs("Powerid")=request("name")
        rs("xb") = request("radiobutton1")
        rs("e-mail") = request("email")
        rs("adr") = request("adr")
        rs("tel") = request("tel")
        rs.Update '更新
        rs.Close
        Set rs = Nothing
        response.Write "<script language=JavaScript>alert('注册成功');window.location.href='default.asp';</script>"
    End If
End If
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	background-image: url(images/2314e-large.jpg);
}
.STYLE2 {font-size: 9pt}
.STYLE3 {font-size: 9pt}
.STYLE4 {color: #FF0000}
body,td,th {
	font-size: 10pt;
}
.STYLE6 {font-size: 10pt; }
.STYLE7 {font-size: 11pt}
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #0000FF;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
-->
</style></head>
<script language="javascript">
function formsubmit(){
	var name=document.all("name").value;
	var pwd=document.all("pass").value;
	var email=document.all("email").value;
	

	if(name==""){
		alert("用户名不能为空!");
		return false;
	}
	if(pwd==""){
		alert("密码不能为空!");
		return false;
	}
	if(email==""){
		alert("邮箱不能为空!");
		return false;
	}
		if (email.charAt(0) == "." || email.charAt(0) == "@" || email.indexOf('@', 0) == -1|| email.indexOf('.', 0) == -1 || email.lastIndexOf("@") == email.length-1 || email.lastIndexOf(".") == email.length-1) {
			  alert("邮箱格式不正确!");
					  return false;
		}
					
	
	return true;
	
}


</script>
<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p class="STYLE6">在线考试系统新用户注册:</p>
<form name="form" method="post" id="form" onSubmit="return formsubmit()">
  <table width="223" height="150" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="81"><div align="right" class="STYLE6">用户名:</div></td>
      <td width="142"><label>
        <input name="name" type="text" id="name" size="15">
      <span class="STYLE4">*</span>      </label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE6">密 码:</div></td>
      <td><label>
        <input name="pass" type="password" id="pass" size="15">
        <span class="STYLE4">*</span></label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE6">性 别:</div></td>
      <td><label>
        <input type="radio" name="radiobutton1" value="男" checked="checked">
      </label>
        <span class="STYLE2">
        <label>
        男</label>
        </span>
        <span class="STYLE3">
        <label></label>
        </span>
        <label>
        <input type="radio" name="radiobutton1" value="女">
        <span class="STYLE3">女</span></label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE6">email:</div></td>
      <td><label>
        <input name="email" type="text" id="email" size="15">
      </label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE6">地址:</div></td>
      <td><label>
        <input name="adr" type="text" id="adr" size="15">
      </label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE6">联系电话:</div></td>
      <td><label>
        <input name="tel" type="text" id="tel" size="15">
      </label></td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td><label>
        <input type="submit" name="Submit" value="注册">
		</label>
        <label>
        <input type="reset" name="Submit2" value="重置">
      </label></td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td>&nbsp;</td>
    </tr>
  </table>

  

  

  

<!--<input type="hidden" name="MM_insert" value="form1">-->
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<style>#D1 {
	BACKGROUND-COLOR: lightgreen; 
	BORDER-BOTTOM: white 2px outset; 
	BORDER-LEFT: white 2px outset; 
	BORDER-RIGHT: white 2px outset; 
	BORDER-TOP: white 2px outset; 
	LEFT: 0px; POSITION: absolute; 
	TOP: 0px; VISIBILITY: hidden; 
	WIDTH: 300px; 
	layer-background-color: lightgreen
}
a{font-size:9pt}
a:link{text-decoration:none}
a:hover{text-decoration:none;color:#FFFFFF}
a:visited{text-decoration:none}
.40pt{font-size:40pt;color:#3399ff;font-family:文鼎琥珀繁}
</style>
<script language="javascript">
function menuIn() //菜单隐藏
{
        if(n4) {
                clearTimeout(out_ID)
                if( menu.top > menuH*-1+20+10 ) {  
                        menu.top -= 8
                        in_ID = setTimeout("menuIn()", 1)
                }
                else if( menu.top > menuH*-1+20 ) {
                        menu.top--
                        in_ID = setTimeout("menuIn()", 1)
                }
        }
        else { 
                clearTimeout(out_ID)
                if( menu.pixelTop > menuH*-1+20+10 ) {
                        menu.pixelTop -= 8
                        in_ID = setTimeout("menuIn()", 1) 
                }
                else if( menu.pixelTop > menuH*-1+20 ) {
                        menu.pixelTop--
                        in_ID = setTimeout("menuIn()", 1)
                }
        }
}
function menuOut() //菜单显示
{
        if(n4) {
                clearTimeout(in_ID)
                if( menu.top < -10) { 
                        menu.top += 4
                        out_ID = setTimeout("menuOut()", 1)
                }
                else if( menu.top < 0) { 
                        menu.top++
                        out_ID = setTimeout("menuOut()", 1)
                }
                
        }
        else { 
                clearTimeout(in_ID)
                if( menu.pixelTop < -10) {
                        menu.pixelTop += 2
                        out_ID = setTimeout("menuOut()", 1)
                }
                else if( menu.pixelTop < 0 ) {
                        menu.pixelTop++
                        out_ID = setTimeout("menuOut()", 1)
                }
        }
}
function fireOver() { 
        clearTimeout(F_out)	       
        F_over = setTimeout("menuOut()", 10) 
}
function fireOut() { 
        clearTimeout(F_over)
         F_out = setTimeout("menuIn()", 10)
}
function init() {
        if(n4) {
                menu = document.D1
                menuH = menu.document.height
                menu.top = menu.document.height*-1+20 
                menu.onmouseover = menuOut
                menu.onmouseout = menuIn
		menu.visibility = "visible"
        }
        else if(e4) {
                menu = D1.style
                menuH = D1.offsetHeight
                D1.style.pixelTop = D1.offsetHeight*-1+20
                D1.onmouseover = fireOver
                D1.onmouseout = fireOut
                D1.style.visibility = "visible"
        }
}
F_over=F_out=in_ID=out_ID=null
n4 = (document.layers)?1:0
e4 = (document.all)?1:0;
</script>
<div id="D1">

<table border="0" width="294">
<TBODY>
  <tr>
    <td align="middle" bgColor="#0066FF" rowSpan="2" width="14"><font color="#FFFFFF">
    M<br>
    E<br>
    N<br>
    U</font></td>
    <td width="127"> <ul>
      <li><span class="STYLE7"><a href="sysm.asp">本站地图</a> </span></li>
      <li class="STYLE7"><a href="yhzc.asp">注册新用户</a> </li>
      <li class="STYLE7"><a href="mailto:fdt_fpg1986@163.com">联系我们</a>      </li>
      <li><span class="STYLE7"><a href="login.asp">
          退出</a></span> </li>
    </ul>
    </td>
    <td width="133">
    </td>
  </tr>
 </TBODY>
</table>
</div>
<body onload="init()" >
</html>