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

📄 user_modifyinfo.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
字号:
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/func.asp"-->
<%
if CheckUserLogined()=False then
	response.Redirect "User_Login.asp"
end if

dim Action,FoundErr,ErrMsg
dim rsUser,sqlUser
Action=trim(request("Action"))
if Action="Modify" then
	UserName=trim(request("UserName"))
else
	UserName=Trim(Request.Cookies("luyeweb")("UserName"))
end if
if  UserName="" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
end if
if FoundErr=true then
	call WriteErrMsg()
else
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	sqlUser="select * from " & db_User_Table & " where " & db_User_Name & "='" & UserName & "'"
	rsUser.Open sqlUser,Conn_User,1,3
	if rsUser.bof and rsUser.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的用户!</li>"
		call writeErrMsg()
	else
		if Action="Modify" then
			dim Sex,Email,Homepage,Company,Department,jszc,birthyear,address,signatue,showre,mobile
			Sex=trim(Request("Sex"))
			Email=trim(request("Email"))
			Homepage=trim(request("Homepage"))
			OICQ=trim(request("OICQ"))
			MSN=trim(request("MSN"))

birthyear=trim(request("birthyear"))
birthmonth=trim(request("birthmonth"))
birthday=trim(request("birthday"))
address=trim(request("address"))
signature=trim(request("signature"))
showre=trim(request("showre"))
mobile=trim(request("mobile"))
			if Sex="" then
				founderr=true
				errmsg=errmsg & "<br><li>性别不能为空</li>"
			else
				sex=cint(sex)
				if Sex<>0 and Sex<>1 then
					Sex=1
				end if
			end if
			if Email="" then
				founderr=true
				errmsg=errmsg & "<br><li>Email不能为空</li>"
			else
				if IsValidEmail(Email)=false then
					errmsg=errmsg & "<br><li>您的Email有错误</li>"
			   		founderr=true
				end if
			end if

if QQ<>"" then
	if not isnumeric(QQ) or len(cstr(QQ))>20 then
		errmsg=errmsg & "<br><li>QQ号码只能是4-20位数字,您可以选择不输入。</li>"
		founderr=true
	end if
end if
if mobile<>"" then
	if not isnumeric(mobile) or len(cstr(mobile))>12 then
		errmsg=errmsg & "<br><li>手机号必须是数字,不超过11位,您可以选择不输入。</li>"
		founderr=true
	end if
end if
if MSN<>"" then
	if IsValidEmail(MSN)=false then
		errmsg=errmsg & "<br><li>你的MSN有误。</li>"
		founderr=true
	end if
end if
			if FoundErr<>true then
				rsUser(db_User_Sex)=Sex
				rsUser(db_User_Email)=Email
				rsUser(db_User_Homepage)=HomePage
				rsUser(db_User_QQ)=OICQ
				rsUser(db_User_Msn)=MSN

		rsUser(db_User_address)=address
		rsUser(db_User_sign)=signature
		rsUser(db_User_showre)=showre
		rsUser(db_User_mobile)=mobile
		if len(birthyear&birthmonth&birthday)>1 then
 		 rsUser(db_User_Birthday)=dateserial(cint(birthyear),cint(birthmonth),cint(birthday))
		end if
				rsUser.update
				call WriteSuccessMsg("成功修改用户信息!")
			else
				call WriteErrMsg()
			end if
		else
%>
<html>
<head>
<title>修改注册用户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="ad_STYLE.CSS" rel="stylesheet" type="text/css">
</head>
<body>
<br>
<FORM name="Form1" action="User_ModifyInfo.asp" method="post">
  <table width=80% border=0 align="center" cellpadding=2 cellspacing=1 class='border'>
    <TR align=center class='title'> 
      <TD height=22 colSpan=2><font class=en><b>修改注册用户信息</b></font></TD>
    </TR>
    <TR class="tdbg" > 
      <TD width="43%" align="right"><b>用 户 名:</b></TD>
      <TD> <%=Trim(Request.Cookies("luyeweb")("UserName"))%> <input name="UserName" type="hidden" value="<%=Trim(Request.Cookies("luyeweb")("UserName"))%>"></TD>
    </TR>
          <TR class="tdbg" > 
            <TD width="43%"><strong>性别:</strong><BR>
              请选择您的性别</TD>
            <TD width="57%"><INPUT type=radio value="1" <%if rsUser(db_user_sex)="1" then%> checked <%end if%> name=sex>男<IMG  src=images/Male.gif align=absMiddle>&nbsp;&nbsp;
			                <INPUT type=radio value="0" <%if rsUser(db_user_sex)="0" then%> checked <%end if%> name=sex>女<IMG  src=images/Female.gif align=absMiddle></TD>
          </TR>

      <tr class="tdbg">    
        <td><B>生日</B><br>填写生日,以便网站在您生日时提醒!<BR>如不想填写,请全部留空</td>   
        <td>
<select name=birthyear>
<option value=></option>
<%
for i=1901 to 2004
response.write "<option value=""" & i & """"
if i=year(rsUser(db_user_birthday)) then response.write "selected "
response.write ">" & i & "</option>"
next
%>
</select>
<select name=birthmonth>
<option value=></option>
<%for i=1 to 12
response.write "<option value=""" & i & """"
if i=month(rsUser(db_user_birthday)) then response.write "selected "
response.write ">" & i & "</option>"
next
%>
</select>
<select name=birthday>
<option value=></option>
<%
for i=1 to 31
response.write "<option value=""" & i & """"
if i=day(rsUser(db_user_birthday)) then response.write "selected "
response.write ">" & i & "</option>"
next
%>
</select>
        </td>   
      </tr>

	<TR class="tdbg" > 
      <TD><strong>Email地址:</strong></TD>
      <TD> <INPUT name=Email value="<%=rsUser(db_User_Email)%>" size=30   maxLength=50> 
      </TD>
    </TR>
    <TR class="tdbg" >
      <TD><strong>OICQ号码:</strong></TD>
      <TD>
        <INPUT name=OICQ id="OICQ" value="<%=rsUser(db_User_QQ)%>" size=30 maxLength=20>
      </TD>
    </TR>
    <TR class="tdbg" >
      <TD><strong>MSN:</strong></TD>
      <TD>
        <INPUT name=msn value="<%=rsUser(db_User_Msn)%>" size=30 maxLength=50>
      </TD>
    </TR>


<tr class="tdbg">
<td ><b>来自哪里?:</b></td><td><input type=text name=address value="<%=rsUser(db_user_address)%>" size=40></td>
</tr>
          <TR class="tdbg" > 
            <TD width="43%"><strong>主页:</strong><BR>
              您的网站地址</TD>
            <TD width="57%"> <INPUT   maxLength=100 size=30 name=homepage value="<%=rsUser(db_user_homepage)%>"></TD>
          </TR>
 <TR class="tdbg" > 
        <TD width="43%"><strong>手机号码:</strong><br>
         请输入你的手机号,不方便可以不填!</TD>
            <TD width="57%"> <INPUT maxLength=20 size=30 name=mobile value="<%=rsUser(db_user_mobile)%>"></TD>
</TR>

<TR class="tdbg"> 
<TD><B>签名</B>:<BR>最多300字节<BR>
文字将出现在您发表的文章的结尾处。体现您的个性。 <br>支持UBB(<a href="inc/ubb_help.asp" target="_blank">UBB帮助</a>) </TD>
<TD> 
<TEXTAREA name=Signature rows=5 cols=50><%=rsUser(db_user_sign)%></TEXTAREA>
</TD>
</TR>
<tr class="tdbg">    
<td><B>是否开放您的基本资料</B>:<BR>不开放别人不能看到您的联系方式等信息</td>  
<td>    
	<input type=radio name=showre value=1 <%if rsUser(db_user_showre) then%> checked <%end if%>>开放&nbsp;&nbsp;
	<input type=radio name=showre value=0 <%if not rsUser(db_user_showre) then%> checked <%end if%>>  不开放
  </td>   
</tr>

    <TR align="center" class="tdbg" > 
      <TD height="40" colspan="2"><input name="Action" type="hidden" id="Action" value="Modify"> 
        <input name=Submit   type=submit id="Submit" value="保存修改结果"> </TD>
    </TR>
  </TABLE>
</form>
</body>
</html>
<%
		end if
	end if
	rsUser.close
	set rsUser=nothing
end if
call CloseConn_User()
%>

⌨️ 快捷键说明

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