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

📄 user_inc.asp

📁 21世纪人才www.51zy.net 网站源码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
sub savepass()
if request.cookies("godbook")("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language="JavaScript" type="text/javascript">
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function passcheck()
{
    if(document.userpass.userpassword.value.length < 6 || document.userpass.userpassword.value.length >20) {
	document.userpass.userpassword.focus();
    alert("密码长度不能不能这空,在6位到20位之间,请重新输入!");
	return false;
  }
   if(document.userpass.userpassword.value!==document.userpass.userpassword2.value) {
	document.userpass.userpassword.focus();
    alert("对不起,两次密码输入不一样!");
	return false;
  }
}
</script>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&request.cookies("godbook")("username")&"' ",conn,1,1
%>
<h2><span class="red">尊敬的用户,我们向您承诺:以下信息将被严格保密,绝对不提供给第三方或用作它用!</span></h2>
<table width="590" cellpadding="0" cellspacing="0">
  <form name="userpass" method="post" action="saveuserinfo.asp?action=savepass">
    <tr> 
      <td class="left1">用 户 名:</td>
      <td class="right1"><%=request.cookies("godbook")("username")%></td>
	</tr>
    <tr> 
      <td class="left1">新 密 码:</td>
      <td class="right1"><input name="userpassword" class="wenbenkuang"; type="password" value="" size="18">
	  <span class="red">**</span> 不修改请为空</td>
    </tr>
    <tr> 
      <td class="left1">密码确认:</td>
      <td class="right1"><input name="userpassword2" class="wenbenkuang" type="password" value="" size="18">
	  <span class="red">**</span></td>
    </tr>
</table>
<p><input class="oksave" onclick="return passcheck();" type="submit" name="submit" value="" /><input class="reset" onclick="ClearReset()" type="reset" name="Clear" value="" /></p>
  </form>
<%rs.close
set rs=nothing
end sub

sub userziliao()
if request.cookies("godbook")("username")="" then
response.Redirect "user.asp"
response.End
end if
%>
<script language="JavaScript" type="text/javascript">
<%dim sql,i,j
	set rs_s=server.createobject("adodb.recordset")
	sql="select * from 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 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 [user] where username='"&request.cookies("godbook")("username")&"' ",conn,1,1%>
<h2><span class="red">尊敬的用户,我们向您承诺:以下信息将被严格保密,绝对不提供给第三方或用作它用!</span></h2>
<form name="userinfo" method="post" action="saveuserinfo.asp?action=userziliao">
<table width="590" cellpadding="0" cellspacing="0">
  <tr>
    <td class="left1">用 户 名:</td>
    <td class="right1"><%=request.cookies("godbook")("username")%> <span class="new"><%if rs("reglx")=2 then %>VIP用户 期限:<%=rs("vipdate")%><%else%>普通会员<%end if%></span></td>
  </tr>
  <tr>
    <td class="left1">电子邮件:</td>
    <td class="right1"><input name="useremail" type=text value="<%=trim(rs("useremail"))%>" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">是否公开邮箱地址:</td>
    <td class="right1"><input class="noborder" type="radio" name="ifgongkai" value="1" <%if rs("ifgongkai")=1 then%>checked<%end if%> /> 公开 <input class="noborder" type="radio" name="ifgongkai" value="0" <%if rs("ifgongkai")=0 then%>checked<%end if%> /> 不公开</td>
  </tr>
  <tr>
    <td class="left1">真实姓名:</td>
    <td class="right1"><input name="userzhenshiname" type="text" value="<%=trim(rs("userzhenshiname"))%>" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">身份证号码:</td>
    <td class="right1"><input name="sfz" type="text" value="<%=trim(rs("sfz"))%>" maxlength="18" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">性别:</td>
    <td class="right1"><input class="noborder" type="radio" name="shousex" value="1" <%if rs("sex")=1 then%>checked="checked"<%end if%> /> 男 <input class="noborder" type="radio" name="shousex" value="0" <%if rs("sex")=0 then%>checked="checked"<%end if%> /> 女 
        <input class="noborder" type="radio" name="shousex" value="2" <%if rs("sex")=2 then%>checked="checked"<%end if%> /> 保密 <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">年龄:</td>
    <td class="right1"><input name="nianling" type="text" value="<%=trim(rs("nianling"))%>" size="4" maxlength="2"> 岁 <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">所在城市:</td>
    <td class="right1"><select size="1" name="szSheng" onchange="chsel()">
          <option value="xxx" selected>请选择省份……</option>
          <%dim tmpShengid
tmpShengid=0
set rs_s=server.createobject("adodb.recordset")
sql="select * from 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="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" name="szShi">
          <%
set rs_s=server.createobject("adodb.recordset")
sql="select * from 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="selected"<%end if%>><%=trim(rs_s("ShiName"))%></option>
          <%
    rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
        </select> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">详细地址:</td>
    <td class="right1"><input name="shouhuodizhi" type="text" value="<%=trim(rs("shouhuodizhi"))%>" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">联系电话:</td>
    <td class="right1"><input name="usertel" type="text" value="<%=trim(rs("usertel"))%>" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">邮编:</td>
    <td class="right1"><input name="youbian" type="text" value="<%=trim(rs("youbian"))%>" onkeypress="event.returnValue=IsDigit();" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">QQ:</td>
    <td class="right1"><input name="QQ" type="text" value="<%=trim(rs("oicq"))%>" /> <span class="red">**</span></td>
  </tr>
  <tr>
    <td class="left1">个人主页:</td>
    <td class="right1"><input name="homepage" type="text" value="<%=trim(rs("homepage"))%>" /></td>
  </tr>
  <tr>
    <td class="left1">自我介绍:</td>
    <td class="right1"><textarea name="content" cols="30" rows="5" ><%=trim(rs("content"))%></textarea></td>
  </tr>
</table>
<p><input class="oksave" onclick="return passcheck();" type="submit" name="submit" value="" /><input class="reset" onclick="ClearReset()" type="reset" name="Clear" value="" /></p>
</form>
<%rs.close
set rs=nothing
end sub
%>

⌨️ 快捷键说明

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