📄 user_inc.asp
字号:
sql="select * from wq_province 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 wq_city 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(province.value) {
city.options.length=0;
for(var i=0;i<selects[province.value].length;i++){
city.add(selects[province.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 [wq_user] where username='"&request.cookies("cnhww")("username")&"' ",conn,1,1
%>
<table width=570 border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#FFFFFF>
<form name="userinfo" method="post" action="saveuserinfo.asp?action=mydata">
<tr>
<td bgcolor=#ffffff colspan=2> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">用 户 名: </div>
</td>
<td height=22><font color=#FF6600><%=request.cookies("cnhww")("username")%> (
<%if rs("reglx")=2 then %>
VIP用户 期限:<%=rs("vipdate")%>
<%else%>
普通会员
<%end if%>
)</font></td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">电子邮件: </div>
</td>
<td height=22>
<input name=useremail type=text value="<%=trim(rs("useremail"))%>">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">邮箱地址: </div>
</td>
<td height=22>
<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 bgcolor="#ffffff">
<td height=22>
<div align="right">真实姓名: </div>
</td>
<td height=22>
<input name=userzhenshiname type=text value="<%=trim(rs("userzhenshiname"))%>">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">身份证号: </div>
</td>
<td height=22>
<input name=sfz type=text value="<%=trim(rs("sfz"))%>" size="20" maxlength="18">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">性 别: </div>
</td>
<td height=22>
<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 bgcolor="#ffffff">
<td height=22>
<div align="right">年 龄: </div>
</td>
<td height=22>
<input name=nianling type=text value="<%=trim(rs("nianling"))%>" size="4" maxlength="2">
</td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">所在城市: </div>
</td>
<td height=22>
<select size="1" style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; BORDER-LEFT: #ffffff 1px groove; COLOR: #333333; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"; name="province" onChange=chsel()>
<option value="xxx" selected>请选择省份……</option>
<%dim tmpShengid
tmpShengid=0
set rs_s=server.createobject("adodb.recordset")
sql="select * from wq_province order by shengorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
if rs("province")=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" style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; BORDER-LEFT: #ffffff 1px groove; COLOR: #333333; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"; name="city">
<%
set rs_s=server.createobject("adodb.recordset")
sql="select * from wq_city 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("city")=rs_s("ShiNo") then%>selected<%end if%>><%=trim(rs_s("ShiName"))%></option>
<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
</select>
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">详细地址: </div>
</td>
<td height=22>
<input name=shouhuodizhi type=text value="<%=trim(rs("shouhuodizhi"))%>">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">联系电话: </div>
</td>
<td height=22>
<input name=usertel type=text value="<%=trim(rs("usertel"))%>" size="12">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">邮 编: </div>
</td>
<td height=22>
<input name=youbian type=text value="<%=trim(rs("youbian"))%>" ONKEYPRESS="event.returnValue=IsDigit();" size="12">
<font color="#FF0000">*</font> </td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">联系 QQ: </div>
</td>
<td height=22>
<input name=QQ type=text value="<%=trim(rs("oicq"))%>" size="12" maxlength="12">
</td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">个人主页: </div>
</td>
<td height=22>
<input name=homepage type=text value="<%=trim(rs("homepage"))%>">
</td>
</tr>
<tr bgcolor="#ffffff">
<td height=22>
<div align="right">自我介绍: </div>
</td>
<td height=22>
<textarea name="content" cols="50" rows="6"><%=trim(rs("content"))%></textarea>
</td>
</tr>
<tr align="center">
<td height=25 bgcolor=#ffffff colspan="2">
<div align="center">
<input type=image border=0 name=submit2 src=images/bc.gif width=54 height=18 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 + -