📄 user_inc.asp
字号:
<tr align="center">
<td height=25 bgcolor=#ffffff colspan="2" > <div align="center">
<input name="Submit2" type="submit" class="go-wenbenkuang" value="提交保存" onclick='return passcheck();'>
</div></td>
</tr>
</form>
</table>
<%rs.close
set rs=nothing
end sub
sub userziliao()
if request.cookies("snsn")("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language=JavaScript>
<%dim sql,i,j
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szSheng order by shengorder"
rs_s.open sql,conn,1,1
%>
var selects=[];
selects['xxx']=new Array(new Option('请选择城市……','xxx'));
<%
for i=1 to rs_s.recordcount
%>
selects['<%=rs_s("ShengNo")%>']=new Array(
<%
set rs_s1=server.createobject("adodb.recordset")
sql="select * From shop_szShi where shengid="&rs_s("id")&" order by shiorder"
rs_s1.open sql,conn,1,1
if rs_s1.recordcount>0 then
for j=1 to rs_s1.recordcount
if j=rs_s1.recordcount then
%>
new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'));
<% else
%>
new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'),
<%
end if
rs_s1.movenext
next
else
%>
new Option('','0'));
<%
end if
rs_s1.close
set rs_s1=nothing
rs_s.movenext
next
rs_s.close
set rs_s=nothing
%>
function chsel(){
with (document.userinfo){
if(szSheng.value) {
szShi.options.length=0;
for(var i=0;i<selects[szSheng.value].length;i++){
szShi.add(selects[szSheng.value][i]);
}
}
}
}
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function checkuserinfo()
{
if(document.userinfo.useremail.value.length!=0)
{
if (document.userinfo.useremail.value.charAt(0)=="." ||
document.userinfo.useremail.value.charAt(0)=="@"||
document.userinfo.useremail.value.indexOf('@', 0) == -1 ||
document.userinfo.useremail.value.indexOf('.', 0) == -1 ||
document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 ||
document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
{
alert("Email地址格式不正确!");
document.userinfo.useremail.focus();
return false;
}
}
else
{
alert("Email不能为空!");
document.userinfo.useremail.focus();
return false;
}
if(checkspace(document.userinfo.userzhenshiname.value)) {
document.userinfo.userzhenshiname.focus();
alert("对不起,请填写您的真实姓名!");
return false;
}
if(checkspace(document.userinfo.sfz.value)) {
document.userinfo.sfz.focus();
alert("对不起,请填写您的身份证号码!");
return false;
}
if((document.userinfo.sfz.value.length!=15)&&(document.userinfo.sfz.value.length!=18)) {
document.userinfo.sfz.focus();
alert("对不起,请正确填写身份证号码!");
return false;
}
if(checkspace(document.userinfo.shouhuodizhi.value)) {
document.userinfo.shouhuodizhi.focus();
alert("对不起,请填写您的详细地址!");
return false;
}
if(checkspace(document.userinfo.youbian.value)) {
document.userinfo.youbian.focus();
alert("对不起,请填写邮编!");
return false;
}
if(document.userinfo.youbian.value.length!=6) {
document.userinfo.youbian.focus();
alert("对不起,请正确填写邮编!");
return false;
}
if(checkspace(document.userinfo.usertel.value)) {
document.userinfo.usertel.focus();
alert("对不起,请留下您的联系电话!");
return false;
}
}
</script>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user] where username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' ",conn,1,1
%>
<table width=98% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC" class="table-zuoshang">
<form name="userinfo" method="post" action="saveuserinfo.asp?action=userziliao">
<tr bgcolor="f1f1f1" class="a1">
<td height="23" colspan=2 > 尊敬的用户,我们向您承诺: 以下信息将被严格保密,绝对不提供给第三方或用作它用。</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">用
户 名: </div></td>
<td height=22 bgcolor="#ffffff" ><%=request.cookies("snsn")("username")%> (
<%if rs("reglx")=2 then %>
VIP用户 期限:<%=rs("vipdate")%>
<%else%>
普通会员
<%end if%>
)</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">电子邮件:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=useremail class="wenbenkuang" type=text value="<%=trim(rs("useremail"))%>">
* </td>
</tr>
<tr >
<td height=22 bgcolor="#ffffff"> <div align="right">是否公开邮箱地址: </div></td>
<td height=22 bgcolor="#ffffff" > <input type="radio" name="ifgongkai" value="1" <%if rs("ifgongkai")=1 then%>checked<%end if%>>
公开
<input type="radio" name="ifgongkai" value="0" <%if rs("ifgongkai")=0 then%>checked<%end if%>>
不公开 </td>
</tr>
<tr >
<td height=22 bgcolor="#ffffff"> <div align="right">真实姓名: </div></td>
<td height=22 bgcolor="#ffffff" > <input name=userzhenshiname class="wenbenkuang" type=text value="<%=trim(rs("userzhenshiname"))%>">
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">身份证号码:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=sfz type=text class="wenbenkuang" value="<%=trim(rs("sfz"))%>" size="20" maxlength="18">
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">性别:
</div></td>
<td height=22 bgcolor="#ffffff" > <input type="radio" name="shousex" value="1" <%if rs("sex")=1 then%>checked<%end if%>>
男
<input type="radio" name="shousex" value="0" <%if rs("sex")=0 then%>checked<%end if%>>
女
<input type="radio" name="shousex" value="2" <%if rs("sex")=2 then%>checked<%end if%>>
保密</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">年龄:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=nianling type=text class="wenbenkuang" value="<%=trim(rs("nianling"))%>" size="4" maxlength="2">
</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">所在城市:
</div></td>
<td height=22 bgcolor="#ffffff" > <select size="1" class="wenbenkuang" name="szSheng" onChange=chsel()>
<option value="xxx" selected>请选择省份……</option>
<%dim tmpShengid
tmpShengid=0
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szSheng order by shengorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
if rs("szSheng")=rs_s("ShengNo") then
tmpShengid=rs_s("id")
%>
<option value="<%=rs_s("ShengNo")%>" selected ><%=trim(rs_s("ShengName"))%></option>
<%
else
%>
<option value="<%=rs_s("ShengNo")%>" ><%=trim(rs_s("ShengName"))%></option>
<%
end if
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
</select> <select size="1" class="wenbenkuang" name="szShi">
<%
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szShi where shengid="&tmpShengid&" order by shiorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
%>
<option value="<%=rs_s("ShiNo")%>" <%if rs("szShi")=rs_s("ShiNo") then%>selected<%end if%>><%=trim(rs_s("ShiName"))%></option>
<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
</select>
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">详细地址:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=shouhuodizhi class="wenbenkuang" value="<%=trim(rs("shouhuodizhi"))%>">
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">联系电话:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=usertel class="wenbenkuang" value="<%=trim(rs("usertel"))%>" size="12">
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">邮编:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=youbian type=text class="wenbenkuang" value="<%=trim(rs("youbian"))%>" ONKEYPRESS="event.returnValue=IsDigit();" size="12">
* </td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">QQ:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=QQ type=text class="wenbenkuang" value="<%=trim(rs("oicq"))%>" size="12" maxlength="12">
</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">个人主页:
</div></td>
<td height=22 bgcolor="#ffffff" > <input name=homepage type=text class="wenbenkuang" value="<%=trim(rs("homepage"))%>">
</td>
</tr>
<tr>
<td height=22 bgcolor="#ffffff" > <div align="right">自我介绍:
</div></td>
<td height=22 bgcolor="#ffffff" > <textarea class="wenbenkuang" name="content" rows="6"><%=trim(rs("content"))%></textarea>
</td>
</tr>
<tr align="center">
<td height=25 bgcolor=#ffffff colspan="2" > <div align="center">
<input name="Submit22" type="submit" class="go-wenbenkuang" value="提交保存" onclick='return checkuserinfo();'>
</div></td>
</tr>
</form>
</table>
<%rs.close
set rs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -