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

📄 regpost.asp

📁 一路飞扬在线同学录单班级版,主要用于个人系统中的同学录,不过对于学习有帮助!
💻 ASP
字号:
<!--#include file="syssetup.asp"-->
<!--#include file="inc/func.INC"-->
<!--#include file="inc/chkonline.asp"-->
<%call online()%>
<%
set rs=server.createobject("ADODB.Recordset")
sql="select * from syssetup"
rs.open sql,conn,1,1
no1=rs("classname")
no2=rs("webname")
%>
<% dim userid,password,truename,sex,byear,bmonth,bday
dim birthday,xingzuo,headpic,mypic,telephone,mobile
dim oicq,email,page,zipcode,address,forq,foran,aihao
dim xinge,music,geyan,sports,job,loveat,goaddress,face
dim logcnt,logtime,artnum,notenum,manclass,blood,idol,regtime
'符号转换函数 sqlstr
 '将数据中的单引号转化为双引号,并且在前面加单引号
 Function Sqlstr(data)
 	sqlstr=Replace(data,"'","''")
 End Function
userid=trim(sqlstr(request.form("userid")))'1代表第一个字段
sql="select userid from txluser where userid='"&userid&"'"
set checkid=conn.execute(sql)
if not checkid.eof then
response.write "<script>alert('该同学ID已被注册,请重试!');history.back();</Script>"
response.end
end if
'用regflag来判断是插入记录,还是修改记录
dim regflag
regflag=request("regflag")
'插入记录
if regflag="reg" then
	classcode=trim(sqlstr(request("classcode")))
	cflag=0
	if (mid(classcode,1,3)="200")  then
	cflag=1
	end if
	if classcode=no1 or classcode=no2 then
	cflag=1
	end if
	if cflag=0 then
	response.write "<script>alert('你可能不是本班成员,请输入正确的学号!');history.back();</Script>"
	response.end
	end if
	password=trim(sqlstr(request.form("password")))'2
	truename=trim(sqlstr(request.form("truename")))'3
	sex=request.form("sex")'4
	snxiao=request.form("snxiao")'5
	blood=request.form("blood")'6
	'构造生日
	byear=request.form("byear")
	bmonth=request.form("bmonth")
	bday=request.form("bday")
	birthday=cdate(byear&"-"&bmonth&"-"&bday)'7
	xingzuo=request.form("xingzuo")'8
	mypic=request.form("mypic")
	if mypic="不必填写" then
	mypic=""
	end if
	headpic=request.form("headpic")'9
	face=headpic
	if  not mypic="" then
	face=mypic
	end if
	

	'函数名ifhave
	'功能:判断变量是否为空,空则值赋予“暂无”
	Function ifhave(data)
	data=trim(sqlstr(data))
	if data="" then
	data="暂无"
	end if
	ifhave=data
	End Function

	telephone=ifhave(request.form("telephone"))'10
	mobile=ifhave(request.form("mobile"))'11
	oicq=ifhave(request.form("oicq"))'12
	email=ifhave(request.form("email"))'13
	page=ifhave(request.form("page"))'14
	zipcode=request.form("zipcode")'15
	address=ifhave(request.form("address"))'16
	forq=ifhave(request.form("forq"))'17
	foran=ifhave(request.form("foran"))'18
	aihao=ifhave(request.form("aihao"))'19
	xinge=ifhave(request.form("xinge"))'20
	idol=ifhave(request.form("idol"))'21
	music=ifhave(request.form("music"))'22
	geyan=ifhave(request.form("geyan"))'23
	sports=ifhave(request.form("sports"))'24
	job=ifhave(request.form("job"))'25
	loveat=ifhave(request.form("loveat"))'26
	goaddress=ifhave(request.form("goaddress"))'27
	logcnt=clng(0)'28
	logtime=date'29
	manclass="0"'32
	regtime=date'33
	sql="insert into txluser(userid,password,truename,sex,snxiao,blood,"
	sql=sql&"birthday,xingzuo,headpic,telephone,mobile,oicq,email,page,"
	sql=sql&"zipcode,address,forq,foran,aihao,xinge,idol,music,geyan,"
	sql=sql&"sports,job,loveat,goaddress,logcnt,logtime,"
	sql=sql&"manclass,regtime) values('"&userid&"','"&password&"','"&truename&"','"&sex
	sql=sql&"','"&snxiao&"','"&blood&"','"&birthday&"','"&xingzuo
	sql=sql&"','"&face&"','"&telephone&"','"&mobile&"','"&oicq
	sql=sql&"','"&email&"','"&page&"','"&zipcode&"','"&address
	sql=sql&"','"&forq&"','"&foran&"','"&aihao&"','"&xinge&"','"&idol
	sql=sql&"','"&music&"','"&geyan&"','"&sports&"','"&job&"','"&loveat
	sql=sql&"','"&goaddress&"','"&logcnt&"','"&logtime&"','"
	sql=sql&manclass&"','"&regtime&"')"
	Set RS = Server.CreateObject("ADODB.Recordset")
	RS.Open "txluser", Conn, 2, 2 , adCmdTable
	RS.AddNew
	rs("userid")=userid
	rs("password")=password
	rs("truename")=truename
	rs("sex")=sex
	rs("snxiao")=snxiao
	rs("blood")=blood
	rs("birthday")=birthday
	rs("xingzuo")=xingzuo
	rs("headpic")=headpic
	rs("telephone")=telephone
	rs("mobile")=mobile
	rs("oicq")=oicq
	rs("email")=email
	rs("page")=page
	rs("zipcode")=zipcode
	rs("address")=address
	rs("forq")=forq
	rs("foran")=foran
	rs("aihao")=aihao
	rs("xinge")=xinge
	rs("idol")=idol
	rs("music")=music
	rs("geyan")=geyan
	rs("sports")=sports
	rs("job")=job
	rs("loveat")=loveat
	rs("goaddress")=goaddress
	rs("logcnt")=logcnt
	rs("logtime")=date
	rs.update
	set rs=nothing
	mysql="update syssetup set lastone='"&truename&"'"
	conn.execute(mysql)
%>	<html>
<head>
<title>成功加入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="jscs/css.CSS" type=text/css rel=stylesheet>
</head>
<script>

var doPopUpX = (screen.width/2)-150;
var doPopUpY = (screen.height/2)-200;
var pos = "left="+doPopUpX+",top="+doPopUpY;

function getpwd(){
getpwd = window.open("get_pwd.asp","找回密码","width=320,height=320,"+pos);
}

</script>
<SCRIPT language=VBScript src="jscs/LOAD.JS"></SCRIPT>
<body topmargin=0>
<%bgcolor="#9FC383"%>
<div align="center">
  <center>
      <table width="490" border="0" cellspacing="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111">
        <tr> 
          <td colspan="6" height="13" width="486"> 
            <div align="center"><font color="#339966"><b>个人信息</b></font></div>
          </td>
        </tr>
        <tr> 
          <td width="20" height="13">&nbsp;</td>
          <td width="82" height="13">同学ID:</td>
          <td width="130" height="13"><img src="<%=headpic%>"><font color=red><%=userid%></font></td>
          <td width="20" height="13">&nbsp;</td>
          <td width="75" height="13">密码:</td>
          <td width="139" height="13"><font color=red><%=password%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">姓名:</td>
          <td width="130"><font color=red><%=truename%></font></td>
          <td width="20"> </td>
          <td width="75">性别:</td>
          <td width="139"><font color=red><%=sex%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">生肖:</td>
          <td width="130"><font color=red><%=snxiao%></font></td>
          <td width="20"> </td>
          <td width="75">血型:</td>
          <td width="139"><font color=red><%=blood%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">生日:</td>
          <td width="130"><font color=red><%=birthday%></font></td>
          <td width="20"> </td>
          <td width="75">星座:</td>
          <td width="139"><font color=red><%=xingzuo%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">电话:</td>
          <td width="130"><font color=red><%=telephone%></font></td>
          <td width="20"> </td>
          <td width="75">手机:</td>
          <td width="139"><font color=red><%=mobile%></font></td>
        </tr>
        <tr> 
          <td width="20" height="15">&nbsp;</td>
          <td width="82" height="15">QQ号码:</td>
          <td width="130" height="15"><font color=red><%=oicq%></font></td>
          <td width="20" height="15">&nbsp;</td>
          <td width="75" height="15">E-mail:</td>
          <td width="139" height="15"><font color=red><%=email%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">邮政编码:</td>
          <td width="130"><font color=red><%=zipcode%></font></td>
          <td width="20"> </td>
          <td width="75"> </td>
          <td width="139"> </td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">提示问题:</td>
          <td width="130"><font color=red><%=forq%></font></td>
          <td width="20"> </td>
          <td width="75">问题答案:</td>
          <td width="139"><font color=red><%=foran%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">个人主页:</td>
          <td colspan="4" width="376"><font color=red><%=page%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">工作单位:</td>
          <td colspan="4" width="376"><font color=red><%=address%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">爱好:</td>
          <td width="130"><font color=red><%=aihao%></font></td>
          <td width="20"> </td>
          <td width="75">性格:</td>
          <td width="139"><font color=red><%=xinge%></font></td>
        </tr>
        <tr> 
          <td width="20"> </td>
          <td width="82">崇拜偶像:</td>
          <td colspan="4" width="376"><font color=red><%=idol%></font></td>
        </tr>
        <tr> 
          <td width="20" height="25"> </td>
          <td width="82" height="25">最喜欢的音乐:</td>
          <td colspan="4" height="25" width="376"><font color=red><%=music%></font></td>
        </tr>
        <tr> 
          <td width="20" height="5">&nbsp;</td>
          <td width="82" height="5">最难忘的格言:</td>
          <td colspan="4" height="5" width="376"><font color=red><%=geyan%></font></td>
        </tr>
        <tr> 
          <td width="20" height="25"> </td>
          <td width="82" height="25">最喜欢的运动:</td>
          <td colspan="4" height="25" width="376"><font color=red><%=sports%></font></td>
        </tr>
        <tr> 
          <td width="20" height="25"> </td>
          <td width="82" height="25">最向往的职业:</td>
          <td colspan="4" height="25" width="376"><font color=red><%=job%></font></td>
        </tr>
        <tr> 
          <td width="20" height="25"> </td>
          <td width="82" height="25">最爱吃的食物:</td>
          <td colspan="4" height="25" width="376"><font color=red><%=loveat%></font></td>
        </tr>
        <tr> 
          <td width="20" height="25"> </td>
          <td width="82" height="25">最爱去的地方:</td>
          <td colspan="4" height="25" width="376"><font color=red><%=goaddress%></font></td>
        </tr>
            </table>
    <p><font color="#009900" size="3" face="楷体_GB2312">朋友,祝贺您成为本站成员!</font><font size="3" face="楷体_GB2312"><font color="#FF9900" size="2" face="宋体">请点击下面“返回首页”返回首页后有用刚注册的ID和密码进行登陆。</font></font></p>
    <p><font size="3" face="楷体_GB2312"><a href="index.asp">返回首页</a></font></p>
  </center>
</div>
    </td>
  </tr>
  <tr> 
    <td height="2"></td>&nbsp;</tr></table></body></html><%
	'修该记录
	else
	userid=session("myuserid")
	password=trim(sqlstr(request.form("password")))'2
	truename=trim(sqlstr(request.form("truename")))'3
	sex=request.form("sex")'4
	snxiao=request.form("snxiao")'5
	blood=request.form("blood")'6
	'构造生日
	byear=request.form("byear")
	bmonth=request.form("bmonth")
	bday=request.form("bday")
	birthday=cdate(byear&"-"&bmonth&"-"&bday)'7
	xingzuo=request.form("xingzuo")'8
	mypic=request.form("mypic")
	if mypic="不必填写" then
	mypic=""
	end if
	headpic=request.form("headpic")'9
	face=headpic
	if  not mypic="" then
	face=mypic
	end if
	picchan=request.form("picchan")
	if picchan<>"" then
	headpic=picchan
	end if

	'函数名ifhave
	'功能:判断变量是否为空,空则值赋予“暂无”
	Function ifhave(data)
	data=trim(sqlstr(data))
	if data="" then
	data="暂无"
	end if
	ifhave=data
	End Function

	telephone=ifhave(request.form("telephone"))'10
	mobile=ifhave(request.form("mobile"))'11
	oicq=ifhave(request.form("oicq"))'12
	email=ifhave(request.form("email"))'13
	page=ifhave(request.form("page"))'14
	zipcode=request.form("zipcode")'15
	address=ifhave(request.form("address"))'16
	forq=ifhave(request.form("forq"))'17
	foran=ifhave(request.form("foran"))'18
	aihao=ifhave(request.form("aihao"))'19
	xinge=ifhave(request.form("xinge"))'20
	idol=ifhave(request.form("idol"))'21
	music=ifhave(request.form("music"))'22
	geyan=ifhave(request.form("geyan"))'23
	sports=ifhave(request.form("sports"))'24
	job=ifhave(request.form("job"))'25
	loveat=ifhave(request.form("loveat"))'26
	goaddress=ifhave(request.form("goaddress"))'27
	if password<>session("mypwd") and request.cookies("flag")="yes" then
	response.cookies("password")=password
	end if
	
	sql="select * from txluser where userid='"&userid&"'"
	set rs=Server.CreateObject("ADODB.recordset")
	rs.open sql,conn,1,3
	rs("password")=password
	rs("truename")=truename
	rs("sex")=sex
	rs("snxiao")=snxiao
	rs("blood")=blood
	rs("birthday")=birthday
	rs("xingzuo")=xingzuo
	rs("headpic")=headpic
	rs("telephone")=telephone
	rs("mobile")=mobile
	rs("oicq")=oicq
	rs("email")=email
	rs("page")=page
	rs("zipcode")=zipcode
	rs("address")=address
	rs("forq")=forq
	rs("foran")=foran
	rs("aihao")=aihao
	rs("xinge")=xinge
	rs("idol")=idol
	rs("music")=music
	rs("geyan")=geyan
	rs("sports")=sports
	rs("job")=job
	rs("loveat")=loveat
	rs("goaddress")=goaddress
	rs.update
	session("mypwd")=password
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing%>
	<script language="Javascript">
	alert('修改成功!请重新登录')
	parent.location.href="index.asp"
	</Script>
	<%end if
	%>

⌨️ 快捷键说明

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