📄 register3.asp
字号:
<!--#INCLUDE FILE="../odbc_connection2.asp"-->
<html>
<head>
<title>注册:第三步</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function check_Null(){
if (document.form1.realname.value==""){
alert("真实姓名不能为空!");
return false;
}
if (document.form1.address.value==""){
alert("通讯地址不能为空!");
return false;
}
if (document.form1.postalcode.value==""){
alert("邮政编码不能为空!");
return false;
}
if (document.form1.email.value==""){
alert("E-mail不能为空!");
return false;
}
return true;
}
// -->
</script>
</head>
<body>
<br>
<table width="607" border="0" align="center">
<tr>
<td width="605" align="center" bgcolor="#FFFFFF">
<table width="90%" border="0">
<tr>
<td height="40" align="center"><h3><font color="#AB0000">用户注册</font></h3></td>
</tr>
<tr>
<td height="30">第三步 填写详细信息
<hr size="1" noshade></td>
</tr>
</table>
<form name="form1" onsubmit="javascript: return check_Null();" action="" method="post">
<table width="80%" border="0" cellPadding="4" cellSpacing=1 borderColorLight="#cccccc" borderColorDark="#ffffff" bgcolor="#999999">
<tr bgcolor="#FFFFFF">
<td width="88" >用户名</td>
<td width="393"><%=Session("UserId")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td >真实姓名</td>
<td ><input size=15 name="realname" type="text" >*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td >通讯地址</td>
<td ><input size=40 name="address" type="text" >*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td >邮政编码</td>
<td ><input size=15 name="postalcode" type="text" >*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td >性别</td>
<td ><input type="radio" name="sex" value="男" checked>男
<input type="radio" name="sex" value="女">女</td>
</tr>
<tr bgcolor="#FFFFFF">
<td >电话 </td>
<td><input type="text" size="25" name="tel"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td >E-mail </td>
<td><input type="text" size="40" name="email">*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>QQ号码 </td>
<td><input type="text" size="15" name="QQ"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td valign="top">个人简介</td>
<td><textarea name="intro" rows="7"cols="50" ></textarea></td>
</tr>
</table>
<p align="center">
<input type="submit" value=" 确 定 " name="submit" class="inputbutton">
</form>
<%
If Request.Form("realname")<>"" And Request.Form("email")<>"" Then
dim UserId,strSql
'从Session中获取用户名
UserId=session("UserId")
'下面组织SQL语句,因为某些项目允许为空,所以需要判断一下
strSql="Update users Set realname='" & Request.Form("RealName") & "'"
strSql=strSql & ",email='" & Request.Form("email") & "'"
strSql=strSql & ",sex='" & Request.Form("sex") & "'"
strSql=strSql & ",SubmitDate=#" & Date() & "#"
strSql=strSql & ",Address='" & Request.Form("address") & "'"
strSql=strSql & ",postalcode='" & Request.Form("postalcode") & "'"
If Request("QQ") <> "" Then
strSql = strSql & ",QQ='" & Request.Form("QQ") & "'"
End If
If Request("tel") <> "" Then
strSql = strSql & ",tel='" & Request.Form("tel") & "'"
End If
If Request("intro") <> "" Then
strSql = strSql & ",intro='" & Request.Form("intro") & "'"
End If
strSql=strSql & " Where UserId='" & UserId & "'"
db.Execute(strSql)
'关闭对象
db.close
set db=nothing
Response.Redirect "register4.asp"
End If
%>
<td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -