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

📄 useredit.asp

📁 树形论坛
💻 ASP
字号:
<!-- #include file="function.asp" -->
<!-- #include file="MD5.asp" -->

<html>
<head>
<meta http-equiv=refresh content=2;url=./>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=forumname%>用户注册</title>

<style>
<!--
BODY{font-size:9pt;}
td        { font-size: 9pt}
-->
</style>
</head>
<body topmargin="50">

myfilename="useredit.asp" 
dim newuserpass 
username=Request.Cookies("username") 
userpass=Request.Cookies("userpass") 
if Request.Cookies("username")=empty or Request.Cookies("userpass")=empty then 
error("您还未登录论坛") 
end if 
set rs=server.createobject("ADODB.Recordset") 
sql="select distinction,userface,userpass,usermail,sign from [user] where username='"&username&"'" 
rs.Open sql,Conn,1,1 
'distinction=Rs("distinction") 
zuserface=Rs("userface") 
zuserpass=Rs("userpass") 
zusermail=Rs("usermail") 
zsign=Rs("sign") 
rs.close 


if action="useredit" and Request.ServerVariables("request_method") = "POST" then 
userpass=md5(Trim(Request.Form("userpass"))) 
newuserpass=Trim(Request.Form("newuserpass")) 
usermail=HTMLEncode(Request.Form("usermail")) 
userface=HTMLEncode(Request.Form("userhead")) 
numcode=HTMLEncode(Request.Form("numcode")) 
if userpass=empty then error("您没有填写旧密码") 

if usermail=empty then  error("您的电子邮件地址没有填写") 
if instr(usermail,"@")=0 then error("您的电子邮件地址填写错误") 
if instr(userface,";")>0 then error("您的头像选择有错") 
if not isnumeric(numcode) and numcode<>"" then error("请您填写表单右边的验证码数字") 
numcode=right(numcode,4) 
if not ISNumeric(numcode) then numcode=1 
if ccur(numcode)<>ccur(Session("numcode")) then error("你输入的验证码有错 ") 
If conn.Execute("Select id From [user] where username='"&username&"' and userpass='"&userpass&"' " ).eof Then error("您填写的旧密码有错") 

sql="select * from [user] where username='"&username&"'" 
rs.Open sql,Conn,1,3 
if newuserpass<>empty then rs("userpass")=md5(newuserpass) 
rs("usermail")=usermail 
rs("userface")=userface 
rs.update 
rs.close 
Set rs=Nothing 
Response.Cookies("username")=username 
if newuserpass<>empty then  
Response.Cookies("userpass")=md5(newuserpass) 
else 
Response.Cookies("userpass")=userpass 
end if 
message="
<ul>
  <li>用户资料修改成功<li><a href=./>返回论坛首页</a>" 
succeed(""&message&"") 
Response.End 
end if 



%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
</ul>
<form name="form"  onsubmit="return VerifyInput();" action="<%=myfilename%>" method="post">
<input type=hidden name="action" value="useredit">
  <table cellSpacing="0" cellPadding="0" width="500" align="center" border="0">
    <tr>
      <td colSpan="3" height="29" style="font-size: 9pt">
      <table cellSpacing="0" cellPadding="0" width="100%" border="0">
        <tr>
          <td width="7" style="font-size: 9pt">
          <img alt src="images/topbg_01.gif" width="7" height="29"></td>
            <td background="images/topbg_02.gif" style="font-size: 9pt"> <table cellSpacing="0" cellPadding="0" width="100%" border="0">
                <tr> 
                  <td width="3%"></td>
                  <td vAlign="center" align="left" width="85%"> <font color="#ffffff"><b><%=forumname%>用户注册</b></font></td>
                  <td align="right" width="12%"> &nbsp;&nbsp;</td>
                </tr>
              </table></td>
          <td width="8" style="font-size: 9pt">
          <img alt src="images/topbg_03.gif" width="8" height="29"></td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="3" background="images/link.gif" style="font-size: 9pt"></td>
      <td vAlign="top" style="font-size: 9pt">
      <table cellSpacing="0" cellPadding="0" width="100%" border="0">
        <tr>
          <td style="font-size: 9pt">
          <table width="100%" align="center" bgColor="#eeead6" border="0">
            <tr>
              <td vAlign="top" style="font-size: 9pt"><fieldset>
              <legend accessKey="F" align="left">用户注册</legend>
			  <table width="95%" align="center" border="0" cellspacing="0" cellpadding="0"height="130">
                      <tr> 
                      <td width="24%" height="10" valign="top">&nbsp;</td>
                      <td width="76%" valign="top">&nbsp;</td>
                    </tr>
					<tr>
                      <td height="20" align="right">用户名:</td>
                      <td>&nbsp; 
                        <input name="username" type="text" size="20" maxlength="15" value="<%=username%>" disabled>
                        <font color="#FF0000">*</font> &nbsp;(15字节)</td> 
                    </tr> 
					<tr>
                      <td height="20" align="right">旧密码:</td>
                      <td>&nbsp; 
                        <input name="userpass" type="password" size="20" maxlength="20">
                        <font color="#FF0000">*</font> &nbsp;(6-20字节)</td>	 
                    </tr> 
					<tr>
                      <td height="20" align="right">新密码:</td>
                      <td>&nbsp; 
                        <input name="newuserpass" type="password" size="20" maxlength="20">
                         &nbsp;(6-20字节)<font color="#FF0000">如果不改密码就留空</font></td> 
                    </tr> 
					<tr>
                      <td height="20" align="right">电子邮箱:</td>
                      <td>&nbsp; 
                        <input name="usermail" type="text" size="30" maxlength="50" value="<%=zusermail%>"> <font color="#FF0000">*</font></td> 
                    </tr> 
					<tr>
                      <td height="20" align="right" valign="top"><img src="images/face/<%=zuserface%>.gif" name="tus" ></td>
                      <td valign="top">&nbsp;<script>function showimage(){document.images.tus.src="images/face/"+document.form.userhead.options[document.form.userhead.selectedIndex].value+".gif";}</script>
选择头像:<select name=userhead size=1 onChange="showimage()"> 
<option value="<%=zuserface%>">不变</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option></select>
<br>
<br>
&nbsp;输入右边的验证码: 
<input name="numcode" type="text" size="6">&nbsp;&nbsp;<img src="validate.asp"></td>
                    </tr> 
                    <tr> 
                      <td height="20" colspan="2" align="center" ><input type=submit name=button value=' 修 改 '> 
                      </td>
                    </tr>
                    <tr> 
                      <td height="2" colspan="2"> </td>
                    </tr>
                    
                  </table>
                  </fieldset></td>
            </tr>
          </table>
          </td>
        </tr>
      </table>
      </td>
      <td width="3" background="images/link.gif" style="font-size: 9pt"></td>
    </tr>
    <tr>
      <td background="images/linkbom.gif" colSpan="3" height="3" style="font-size: 9pt"></td>
    </tr>
  </table>
  </form>

  </body>
</html>
<SCRIPT>
function VerifyInput()
{
username=document.form.username.value

if (username == "")
{
alert("请输入您的用户名");
document.form.username.focus();
return false;
}

if (document.form.usermail.value == "")
{
alert("请输入您的EMAIL地址");
document.form.usermail.focus();
return false;
}

var mail = document.form.usermail.value;
if(mail.indexOf('@',0) == -1 || mail.indexOf('.',0) == -1){
alert("您输入的Email有错误\n请重新检查您的Email");
document.form.usermail.focus();
return false;
}
return true;
}
</SCRIPT>

⌨️ 快捷键说明

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