Supports Chinese characters, words, Numbers, sensitive character masking
🎜> Repeat password:
> Verification code:
🎜> Can’t see clearly? Please click on the verification code to refresh
Not accepted
:http ://cceer.xmu.edu.cn/blog/
2.detect.js view plaincopy to clipboardprint? var flag= [0,0,0,0,0,0]; var $=function(tagName){ return document.getElementsByTagName(tagName); } } //----- -----Accept the agreement function accept_info(){ flag[0]=1; check_data(); } } //--------- -Rejection of the agreement function refuse_info(){ flag[0]=0; check_data(); } } //----------Reset function reset_info(){ var info=["Support Chinese characters, words, numbers, sensitive character masking", "Password between 6-16 characters, sensitive character masking","","Email is important for contact Means", "Can't see clearly? Please click the verification code to refresh"] ].innerHTML=info[i]; flag[i]=0; } } for(var i=0;i //---------Email detection function check_email(email){ var reEmail=/^w ([- .]w )*@w ([-.] w )*.w ([-.]w )*$/; var b_email=reEmail.test(email); if(b_email){ $("span")[3]. innerHTML=" Email is available"; $("span")[3].innerHTML =" Email error"; flag[1]=0; check_data(); Detection function check_password(obj){ var pwd=$("input")[1].value; var reChinese=/[u0391-uFFE5] /; var b_chin ese=reChinese. test(pwd); var reSpace=/s /; var b_space=reSpace.test(pwd); //-------Length test if(pwd.length $("span")[1].innerHTML=" Password length cannot be less than 6"; flag[2]=0; check_data(); } Contains Chinese "; " " " flag[2]=0; " " " " check_data(); " " else if( b_space){ $("span")[1].innerHTML=" Password cannot contain spaces"; flag[2]=0; check_data(); } //-------Display password strength when legal var msg=new Array(" Password strength is poor", " Password strength is average", " Password strength is strong"); if($("input")[2].value!=""){ check_pw(); return flag[2 ]=1; check_data() ; var ls =-1; { ls ; 🎜> return ls; } //---------Password consistency check function check_pw(){ var pwd=$("input")[1].value.toString(); var check_pwd=$("input")[2].value.toString(); if(flag[2]==1){ if(pwd==check_pwd){ $( "span")[2].innerHTML=" Password can be used"; flag[3]=1; check_data(); } else{ $("span")[2].innerHTML=" The two passwords are different"; flag[3]=0; check_data(); Judgment var reId=/^[wu0391-uFFE5] $("span")[0 ].innerHTML=" Illegal ID name"; else{//Legal username uses ajax’s checkid() Check whether it has been registered check_data() { if(flag[0]==1 && flag[1]==1 && flag[2]==1 && flag[3]==1 && flag[4]==1 && flag[5] ==1){ put")[8].disabled=true; --------------------------------
var flag=[0,0,0,0, 0,0]; var $=function(tagName){ return document.getElementsByTagName(tagName); } //----------Accept the agreement Function accept_info(){ flag[0]=1; check_data(); } //----------Reject protocol function refuse_info( ){ flag[0]=0; //----------Reset function reset_info(){ var info=["Support Chinese characters, words, numbers, sensitive character masking", "Password in 6- Between 16 bits, sensitive characters are shielded "," "," email is an important means "," Can't see it clearly? Please click the verification code to refresh "] for (var I = 0; I 0 ;i //----------Email detection Function check_email(email){ var reEmail=/^w ([- .]w )*@w ([-.] w )*.w ([-.]w )*$/; var b_email=reEmail.test(email); if(b_email){ $("span")[3]. innerHTML="Email is available"; $("span")[3].innerHTML=" Email Error"; flag[1]=0; Function check_password (obj){ var pwd=$("input")[1].value; var reChinese=/[u0391-uFFE5] /; var b_chinese=reChinese.test(pwd); var reSpace=/s /; var b_space=reSpace.test(pwd); > $("span")[1].innerHTML="Password length cannot be less than 6"; > //--- ----Legality check: cannot contain Chinese characters else if(b_chinese){ $("span")[1].innerHTML="Password cannot contain Chinese"; flag[2]= 0; check_data();
flag[2]=0; else{ The message prompt var num = getResult (pwd); varm msg = new array )[1].innerHTML=msg[num]; return flag [2]=1; check_data(); function getResult(s ){ var ls =-1; if (s.match(/[a-z]/ig)){ ls ; } if (s.match(/[0 -9]/ig)){ > //---------Password consistency check function check_pw(){ var pwd=$("input")[1].value.toString(); var check_pwd=$("input")[2].value.toString(); if(flag[2]==1){ if(pwd==_pwd){check $( "span")[2].innerHTML="Password can be used"; 🎜> else{ )[2].innerHTML="Two passwords are not the same"; flag[3]=0; > . -------- username legality detection Function Check_id (ID_name) {// can only be letters and numbers. Whether the same uses Ajax to judge var Reid =/^[wu0391-uffe5] $/ ; var b_id=reId.test(id_name); if(!b_id){ > flag[4 ]=0; check_data(); > =1 && flag[2]==1 && flag[3]==1 && flag[4]==1 && flag[5]==1){ =false;
else{ $("input")[8].disabled=true; } }
//-------------------------------------------------------------------- 3.ajax.js view plaincopy to clipboardprint? function checkcode(regcode){ var xmlhttp; try{ xmlhttp=new XMLHttpRequest(); } catch(e){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4){ if (xmlhttp.status==200){ var data=xmlhttp.responseText; code_result(data); } else{ $("span")[4].innerHTML="验证码校验失败,请联系管理员"; } } else{ $("span")[4].innerHTML="正在进行验证码校验..."; } } xmlhttp.open("post", "check_code.asp", true); xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); xmlhttp.send("regcode=" escape(regcode)); } function code_result(data){ var resultbox=$("span")[4]; if(data==1){ resultbox.innerHTML=' 验证码正确'; flag[5]=1; check_data(); } else{ resultbox.innerHTML=' 验证码错误'; flag[5]=0; check_data(); } }
//-------------------------------------------------------------------- function checkid(regid){ var xmlhttp; try{ xmlhttp=new XMLHttpRequest(); } catch(e){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4){ if (xmlhttp.status==200){ var data=xmlhttp.responseText; 🎜> id_result(data); 🎜> else{ $("span")[0].innerHTML="Username verification in progress..."; else{ } xmlhttp.open("post", "check_id.asp", true); xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); xmlhttp.send("regid=" escape(regid) ); } function id_result(data){ var resultbox=$("span")[0]; if(data==1){ resultbox.innerHTML=' Username available'; flag[4]=1; check_data(); else{ resultbox.innerHTML=' This username has been Register'; flag[4]=0; check_data(); -------------------------------------------------- ---- function sendinfo(regname,pwd,email){ var xmlhttp; try{ catch(e){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp. status==200){ var data=xmlhttp.responseText; reg_result(data); } } else{ $("span")[5].innerHTML="Register Failed, please contact the administrator"; } } xmlhttp.open("post", "reg.asp", true); xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); xmlhttp .send("regname=" escape(regname) "&pwd=" escape(pwd) "&email=" escape(email)); } function reg_result(data){ if(data== 1){ $("span")[5].innerHTML='' $("input")[0].value ",Hello. Please click here to log in"; Download (including all files, pictures, databases, etc., please test under IIS after decompression)
A registration system with good experience.rar
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn