reg.asp

来自「修正的自由领域投票系统2.0 支持文件上传」· ASP 代码 · 共 69 行

ASP
69
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=schoolname%>--<%=schoolvote%></title>
</head>
<% if reg="false" then 
response.Write("<script>window.alert('系统当前不允许注册!');window.close()</script>")
response.End()
end if
if request.QueryString("action")="addusername" then 
call addusername
end if%>
<body><form action="?action=addusername" method="post">
<table width="300" align="center">
  
<tr>
  <td width="90"><div align="right">姓&nbsp;&nbsp;名:</div></td>
  <td width="198"><label>
    <input name="sname" type="text" id="sname" />
  </label></td>
</tr>
<tr>
  <td height="15"><div align="right">
    <div align="right">学&nbsp;&nbsp;号:</div>
  </div></td>
  <td><input name="sid" type="password" id="sid" /></td>
</tr>
<tr>
  <td height="15"><div align="right">重复学号:</div></td>
  <td height="15"><label>
    <input type="password" name="resid" />
  </label></td>
</tr>
<tr>
  <td height="15" colspan="2"><div align="center">
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
  </div></td>
</tr></table>
</form>
<%sub addusername
sname=request.Form("sname")
sid=request.Form("sid")
resid=request.form("resid")
if sid<>resid then
response.write("<script>window.alert('两次学号输入不一致!');history.go(-1)</script>")
response.End()
end if
sname=replace(sname,"'","‘")
sid=replace(sid,"'","‘")
set rs=conn.execute("select * from ec where sid='"&sid&"'")

   if rs.eof=-1 then
      conn.execute="insert into ec(sname,sid) values('"&sname&"','"&sid&"')"
   else
      response.Write("<script>window.alert('已经存在该学生编号!');history.go(-1)</script>")
	  response.End()
   end if
   response.Write("<script>window.alert('添加成功!');window.close();</script>")
   response.End()
end sub%>
</body>
</html>

⌨️ 快捷键说明

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