Member Registration Verification Code (PHP tutorial +mysql tutorial +ajax)
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<html>
<head>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<link href= "images/css tutorial. css" rel= "stylesheet" type= "Text/css"/>
<title> Member Registration Verification Code (PHP+MYSQL+AJAX) </title>
<script language= "Web Effects" src= "Web effects/common. Web Effects" ></script>
<script language= "Web Effects" src= "Js/prototype.js" ></script>
<script language= "javascript" src= "Js/passwordstrength.js" ></script>
<script language= "JavaScript" >
var icon = ';
var ns = ["usr", "pwd", "repwd", "eml"];
function Changeusr () {
if ($ ("checkbtn"). Disabled) $ ("checkbtn"). Disabled = false;
}
function Checkusr (s) {
var ma = [user name (4-16-bit)! "," The user name by the number, English, underline, the bar line composition! "];
if (!limitlen (s,4,16)) {
Showinfo ("usr", ma[0]);
return false;
}
if (!hasaccountchar (s)) {
Showinfo ("usr", ma[1]);
return false;
}
Showinfo ("usr");
return true;
}
function Checkpwd (s) {
var ma = [Password (6-16-bit)! "," The password cannot contain Chinese or full-width symbols! "," two times entered the password inconsistent! "];
PS Tutorial. Update (s);
if (!limitlen (s,6,16)) {
Showinfo ("pwd", ma[0]);
return false;
}
if (Haschinesechar (s)) {
Showinfo ("pwd", ma[1]);
return false;
}
if (Limitlen ($f ("Repwdinput"), 6,16)) {
if (Trim ($f ("repwdinput")) = = Trim (s)) {
Showinfo ("pwd");
Showinfo ("Repwd");
return true;
}else{
Showinfo ("pwd", ma[2]);
return false;
}
}
Showinfo ("pwd");
return true;
}
function Checkpwd2 (s) {
var ma = ["Confirm Password (6-16-bit)!" "," The password cannot contain Chinese or full-width symbols! "," two times entered the password inconsistent! "];
if (!limitlen (s,6,16)) {
Showinfo ("Repwd", ma[0]);
return false;
}
if (Haschinesechar (s)) {
Showinfo ("Repwd", ma[1]);
return false;
}
if (Limitlen ($f ("Pwdinput"), 6,16)) {
if (Trim ($f ("pwdinput")) = = Trim (s)) {
Showinfo ("pwd");
Showinfo ("Repwd");
return true;
}else{
Showinfo ("Repwd", ma[2]);
return false;
}
}
Showinfo ("Repwd");
return true;
}
function Checkeml (s) {
var ma = [Please enter a common message!] "," the message format is not correct! "];
if (S.length < 5) {
Showinfo ("eml", ma[0]);
return false;
}
if (!isemail (s)) {
Showinfo ("eml", ma[1]);
return false;
}
Showinfo ("eml");
return true;
}
function Showinfo (n,s) {
var Fdo = $ (n+ "Framediv");
var ido = $ (n+ "Infodiv");
if (typeof s = = ' undefined ') {
Fdo.classname = "Framedivpass";
ido.innerhtml = "<img src=images/duihao.jpg>";
}else{
Fdo.classname = "Framedivwarn";
ido.innerhtml = icon + S;
}
}
//======================================================;
function Loadcheck () {
if (Trim ($f (' Usrinput ')). length = 0) return;
$ ("checkbtn"). Disabled = true;
var o = $ ("Checkdiv");
o.innerhtml = Getloadinfo ();
Loadajaxdata ("reg.php", {usr: $f (' usrinput ')},successcheck,errorcheck);
}
function Successcheck (v) {
var o = $ ("Checkdiv");
o.innerhtml = getcheckhtml (V.responsetext);
}
function Errorcheck () {
$ ("checkbtn"). Disabled = false;
var o = $ ("Checkdiv");
o.innerhtml = GetErrorInfo ();
}
function getcheckhtml (s) {
s = (s = = "1")? "Congratulations, user name can be registered!" ":" Sorry, the username has been registered! ";
return s;
}
//======================================================;
function Getloadinfo () {
Return ' Loading data ... '
}
function GetErrorInfo () {
Return ' data loading failed! '
}
//======================================================;
function Initpage () {
for (Var i=0;i<ns.length;i++) {
$ (ns[i]+ "input"). Value = "";
}
}
function Checksignup () {
if (Document.formsignup.reauthnum.value = = "") {
Window.alert (' Please enter the authentication code!! ');
Document.formsignup.reauthnum.focus ();
return false;
}
return true;
}
function Isallow_jewellry () {
if (document.formsignup.agree.checked = = False) {
Document.formsignup.submit.disabled = true;
}else if (document.formsignup.agree.checked = = True) {
document.formsignup.submit.disabled = false;
}
}
</script>
<body class= "StatusBar" onload= "initpage ();" >
<table width= "100%" class= "wn_login_01" >
<tr>
<td></td>
</tr>
</table>
<table width= "100%" >
<tr>
<TD height= "></td>"
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD height= "class=" "Hyzc-4" ></td>
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD height= "class=" "Hyzc-5" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD class= "Hyzc-8" > Please register members, only members can post posts, visitors can reply and use the Quick response function!</td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "420" ><font class= "hyzc-1-1" > Hint: </font><font class= "hyzc-9" > If you have already registered a member, please skip this step, Just click here </font></td>
<TD width= "248" ><form id= "Form1" Name= "Form1" method= "Post" action= "" >
<input type= "image" Name= "ImageField" src= "Images/hyzc-3.jpg"/>
</form>
</td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "653" height= "1" class= "Hyzc-1-2" ></td>
<TD width= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<form id= "Form2" name= "Formsignup" method= "POST" action= "" >
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "130" ><font class= "hyzc-1-1" > Fill in Login name and password </font>&nbsp;&nbsp;<font class= " Hyzc-6 ">*</font></td>
<TD width= "align=" "right" > Login name:</td>
<TD class= "Hyzc-1-5" >
<span class= "Framedivnormal" id= "Usrframediv" >
<input type= "text" name= "Usrinput" id= "Usrinput" class= "Hyzc-1-3" onkeyup= "checkusr (This.value); Changeusr ();" Onfocus= "CHECKUSR (this.value);" >&nbsp;&nbsp;<span id= "Usrinfodiv" class= "hyzc-6" ></span></span>
</td>
<TD width= "4" class= "Hyzc-7" ></td>
<tr><tr height=30><td class= "hyzc-7" ></td><td></td><td></td>< TD></TD><TD valign=bottom>&nbsp;&nbsp;<input name= "checkbtn" type= "button" id= "Checkbtn" Onclick= "Loadcheck ()" value= "detects if user name is available" >&nbsp;&nbsp;&nbsp;<span id= "Checkdiv" ></span ></TD><TD class= "Hyzc-7" ></td></tr>
</table>
<table width= "721" border= "0" align= "center" ><tr><td width= "4" class= "Hyzc-7" ></td><td Width= "713" height= "8" ></TD><TD width= "4" class= "Hyzc-7" ></td></table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "165" ></td>
<TD width= "Ten" ><font class= "hyzc-6" >*</font></td>
<TD width= "align=" "right" > enter login password:&nbsp;</td>
<td><span class= "Framedivnormal" id= "Pwdframediv" > <input name= "pwdinput" type= "password" Pwdinput "maxlength=" "onkeyup=" Checkpwd (this.value); "Onfocus=" checkpwd (this.value); "class=" Hyzc-1-3 ">& Nbsp;&nbsp;<span id= "Pwdinfodiv" class= "hyzc-6" ></span>
</span>
</td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
<tr height=30><td class= "hyzc-7" ></td><td></td><td></td><td>< /td><td><script language= "JavaScript" >
var ps = new Passwordstrength ();
Ps.setsize ("200", "22");
</SCRIPT></TD><TD class= "Hyzc-7" ></td></tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "5" ></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "165" ></td>
<TD width= "Ten" ><font class= "hyzc-6" >*</font></td>
<TD width= "align=" "right" > enter password again:&nbsp;</td>
<TD >
<span class= "Framedivnormal" id= "Repwdframediv" ><input name= "repwdinput" type= "password" id= "Repwdinput" Maxlength= "onkeyup=" Checkpwd2 (This.value), "onfocus=" Checkpwd2 (this.value); "class=" Hyzc-1-3 ">&nbsp; &nbsp;
<span id= "Repwdinfodiv" class= "hyzc-6" ></span>
</span>
</td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "5" ></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "653" height= "1" class= "Hyzc-1-2" ></td>
<TD width= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "><font" class= "hyzc-1-1" > Fill out profile information </font></td>
<TD width= "Ten" ><font class= "hyzc-6" >*</font></td>
<TD width= "align=" "right" > Mailbox:&nbsp;</td>
<td><span class= "Framedivnormal" id= "Emlframediv" ><input name= "Emlinput" type= "text" id= "Emlinput" Onfocus= "Checkeml" (This.value), "onkeyup=" checkeml (This.value), "maxlength=" class= "Hyzc-1-3" >&nbsp; &nbsp;
<span id= "Emlinfodiv" class= "hyzc-6" ></span>
</span>
</td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "5" ></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<TD width= "Ten" ></td>
<TD width= "align=" "right" > Sex:</td>
<TD width= "175" class= "hyzc-1-5" ><input "name=" "RadioButton" Type= "Radio" value= "RadioButton" Checked "/>
Male <input type= "Radio" name= "RadioButton" value= "RadioButton"/>
Female </td>
<TD width= "270" ></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<TD width= "Ten" ></td>
<TD width= "align=" "right" > Birth date:</td>
<TD width= "class=" "Hyzc-1-5" >
<select name= "Select" >
<option value= "1" >1900</option>
<option value= "1" >2009</option>
</select> year
<select name= "Select" >
<option value= "1" >01</option>
<option value= "1" >02</option>
<option value= "1" >03</option>
<option value= "1" >04</option>
<option value= "1" >05</option>
<option value= "1" >06</option>
<option value= "1" >07</option>
<option value= "1" >08</option>
<option value= "1" >09</option>
<option value= "1" >10</option>
<option value= "1" >11</option>
<option value= "1" >12</option>
</select> Month
<select name= "Select" >
<option value= "1" >01</option>
<option value= "2" >02</option>
<option value= "3" >03</option>
<option value= "4" >04</option>
<option value= "5" >05</option>
<option value= "6" >06</option>
<option value= "7" >07</option>
<option value= "8" >08</option>
<option value= "9" >09</option>
<option value= "Ten" >10</option>
<option value= "One" >11</option>
<option value= ">12</option>"
<option value= ">13</option>"
<option value= ">14</option>"
<option value= ">15</option>"
<option value= ">16</option>"
<option value= ">17</option>"
<option value= ">18</option>"
<option value= ">19</option>"
<option value= ">20</option>"
<option value= ">21</option>"
<option value= ">22</option>"
<option value= ">23</option>"
<option value= ">24</option>"
<option value= ">25</option>"
<option value= ">26</option>"
<option value= ">27</option>"
<option value= ">28</option>"
<option value= ">29</option>"
<option value= ">30</option>"
<option value= ">31</option>"
</select> Day </td>
<TD width= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<TD width= "Ten" ><font class= "hyzc-6" >*</font></td>
<TD width= "align=" "right" > Verification Code:</td>
<TD width= "112" class= "Hyzc-1-5" >
<input type= "text" name= "Reauthnum" class= "hyzc-1-6"/> </td>
<TD width= "><img" src= "Images/authimg.png" ></td>
<TD width= "262" ><a href= "#" class= "hyzc-3" > Can't see picture </a></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "653" height= "1" class= "Hyzc-1-2" ></td>
<TD width= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<TD width= "><font" class= "hyzc-6" >*</font></td>
<TD width= "><input name=" Agree "type=" checkbox "class=" Hyzc-1-7 "value=" 1 "checked=" checked "onclick=" Isallow_jewellry () "/></td>
<TD width= "503" > I have read and agreed to <a href= "#" class= "hyzc-1-8" > "People online Forum Network Service usage Agreement" </a></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<TD width= "558" ><textarea name= "textarea" class= "hyzc-1-9" readonly= "ReadOnly" >
</textarea></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "></td>"
<TD width= "></td>"
<td><input type= "Submit" name= "Submit" value= "Submission Confirmation" tabindex= "1" onclick= ' Javascript:return checksignup () ' ></td>
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" border= "0" align= "center" >
<tr>
<TD width= "4" class= "Hyzc-7" ></td>
<TD width= "713" height= "></td>"
<TD width= "4" class= "Hyzc-7" ></td>
</tr>
</table>
<table width= "721" align= "Center" >
<tr>
<TD class= "wn_login_02_06" ></td>
</tr>
</table>
</form>
</body>
The following JS file code
<script language= "JavaScript" >
Js/common.js
referencing js/css files;
function include (Path,type,title) {
var s,i,t;
if (Arguments.length < 1) {
return;
}
if (arguments.length = = 1) {
Type = "JS";
}
Switch (Type.tolowercase ()) {
Case "CSS":
t = document.getElementsByTagName ("link");
for (i=0;i<t.length;i++) {
if (t[i].href && t[i].href.indexof (path)!=-1) {
Return
}
}
S=document.createelement ("link");
S.rel= "Alternate stylesheet";
S.type= "Text/css";
S.href=path;
S.title=title;
S.disabled=false;
Break
Case "JS":
Case "JavaScript":
Default
t = document.getelementsbytagname ("script");
for (i=0;i<t.length;i++) {
if (t[i].src && t[i].src.indexof (path)!=-1) {
Return
}
}
S=document.createelement ("script");
S.type= "Text/javascript";
S.src=path;
Break
}
var h=document.getelementsbytagname ("head") [0];
H.appendchild (s);
}
character processing;
Go to the left and right space;
function Trim (s) {
return RTrim (LTrim (s));
}
Go to the left space;
function LTrim (s) {
Return S.replace (/^s*/, "");
}
Go to the right space;
function RTrim (s) {
Return S.replace (/s*$/, "");
}
verification information;
null character value;
function IsEmpty (s) {
s = Trim (s);
return s.length = = 0;
}
Email
function Isemail (s) {
s = Trim (s);
var p =/^[_.0-9a-z-]+@ ([0-9a-z][0-9a-z-]+.) {1,4} [A-z] {2,3}$/i;
return P.test (s);
}
Digital
function Isnumber (s) {
return!isnan (s);
}
color value;
function IsColor (s) {
s = Trim (s);
if (S.length!=7) return false;
Return S.search (/#[a-fa-f0-9]{6}/)!=-1;
}
mobile phone number;
function IsMobile (s) {
s = Trim (s);
var p =/13d{9}/;
return P.test (s);
}
Id
function Iscard (s) {
s = Trim (s);
var p =/^d{15} (d{2}[xx0-9])? $/;
return P.test (s);
}
Url
function Isurl (s) {
s = Trim (s). toLowerCase ();
var p =/^http://[a-za-z0-9]+. [a-za-z0-9]+[/=?%-&_~ ' @[] ': +!] * ([^<> ""]) *$/;
return P.test (s);
}
Phone
function Isphone (s) {
s = Trim (s);
var p =/^ ((d{3}) | ( d{3}-))? ((0d{2,3}) |0d{2,3}-)? [1-9]d{6,7}$/;
return P.test (s);
}
Zip
function Iszip (s) {
s = Trim (s);
var p =/^[1-9]d{5}$/;
return P.test (s);
}
Double
function Isdouble (s) {
s = Trim (s);
var p =/^[-+]?d+ (. d+)? $/;
return P.test (s);
}
Integer
function Isinteger (s) {
s = Trim (s);
var p =/^[-+]?d+$/;
return P.test (s);
}
中文版;
function Isenglish (s) {
s = Trim (s);
var p =/^[a-za-z]+$/;
return P.test (s);
}
Chinese
function Ischinese (s) {
s = Trim (s);
var p =/^[u0391-uffe5]+$/;
return P.test (s);
}
Double byte
function Isdoublechar (s) {
var p =/^[^x00-xff]+$/;
return P.test (s);
}
Contains Chinese characters
function Haschinesechar (s) {
var p =/[^x00-xff]/;
return P.test (s);
}
function Hasaccountchar (s) {
var p =/^[a-za-z0-9][a-za-z0-9_-]{0,15}$/;
return P.test (s);
}
function Limitlen (S,min,max) {
S=trim (s);
if (s== "") return false;
if ((s.length<min) | | (S.length>max))
return false;
Else
return true;
}
function
Delay event;
function Setdeferevent (type,action,time) {
if (Trim (time). length = = 0) time = 1;
if (typeof (Time)!= "number") time = 1;
Switch (Type.tolowercase ()) {
Case "Go":
Window.settimeout ("window.location= '" + Action + "" ", time);
Break
Case "alert":
Window.settimeout ("alert (' + action + ')", time);
Break
Case "JS":
Case "JavaScript":
Window.settimeout ("'" + action.tostring () + "", time);
Break
Default
Alert ("Nothing would do!");
Break
}
}
function Addloadlistener (handler) {
if (typeof Window.addeventlistener!= ' undefined ')
Window.addeventlistener (' Load ', handler, false);
else if (typeof document.addeventlistener!= ' undefined ')
Document.addeventlistener (' Load ', handler, false);
else if (typeof window.attachevent!= ' undefined ')
Window.attachevent (' onload ', handler);
};
function AddEventListener (element, EventType, handler, capture)
{
Try
{
if (Element.addeventlistener)
Element.addeventlistener (EventType, Handler, capture);
else if (element.attachevent)
Element.attachevent ("on" + EventType, handler);
}
catch (e) {}
};
function RemoveEventListener (element, EventType, handler, capture)
{
Try
{
if (Element.removeeventlistener)
Element.removeeventlistener (EventType, Handler, capture);
else if (element.detachevent)
Element.detachevent ("on" + EventType, handler);
}
catch (e) {}
};
Image
function Preloadimages () {
var d = document;
if (d.images) {
if (!d.p_i_a) d.p_i_a = new Array ();
var i,j=d.p_i_a.length,a=arguments;
for (i=0;i<a.length;i++) {
d.p_i_a[j]= new Image ();
D.P_I_A[J++].SRC = A[i];
}
}
}
AJAX features;
function Loadajaxelement (e,u,p,f,l) {
if (Arguments.length < 3) {
return;
}
o = $ (e);
o.innerhtml = l;
p = $h (P). toquerystring ();
New Ajax.updater (
{Success:e},
U
{method: ' Get ', Parameters:p, onfailure:f});
}
function Loadajaxdata (u,p,s,f) {
if (Arguments.length < 3) {
return;
}
p = $h (P). toquerystring ();
New Ajax.request (
U
{method: ' Get ', Parameters:p, onsuccess:s,onfailure:f});
}
function Sendajaxelement (e,u,p,f,l) {
if (Arguments.length < 3) {
return;
}
o = $ (e);
o.innerhtml = l;
p = $h (P). toquerystring ();
New Ajax.updater (
{Success:e},
U
{method: ' Post ', Parameters:p, onfailure:f});
}
function Sendajaxdata (u,p,s,f) {
if (Arguments.length < 3) {
return;
}
p = $h (P). toquerystring ();
New Ajax.request (
U
{method: ' Post ', Parameters:p, onsuccess:s,onfailure:f});
}
</script>
<script language= "JavaScript" >
Js/prototype.js
/*
This article you can go to the jquery website to download Oh. or to
Http://www.111cn.net/js/prototype.js Download
*/
</script>
<script language= "JavaScript" >
Js/passwordstrength.js
Password strength;
function Passwordstrength (showed) {
this.showed = (typeof (showed) = = "Boolean")? Showed:true;
This.styles = new Array ();
This.styles[0] = {backgroundcolor: "#ebebeb", Borderleft: "Solid 1px #ffffff", BorderRight: "Solid 1px #bebebe", BorderBottom: "Solid 1px #bebebe"};
This.styles[1] = {backgroundcolor: "#ff4545", Borderleft: "Solid 1px #ffffff", BorderRight: "Solid 1px #bb2b2b", BorderBottom: "Solid 1px #bb2b2b"};
This.styles[2] = {backgroundcolor: "#ffd35e", Borderleft: "Solid 1px #ffffff", BorderRight: "Solid 1px #e9ae10", BorderBottom: "Solid 1px #e9ae10"};
This.styles[3] = {backgroundcolor: "#95eb81", Borderleft: "Solid 1px #ffffff", BorderRight: "Solid 1px #3bbc1b", BorderBottom: "Solid 1px #3bbc1b"};
this.labels= ["Weak", "medium", "strong"];
This.divname = "Pwd_div_" +math.ceil (Math.random () *100000);
This.minlen = 6;
This.width = "150px";
This.height = "16px";
This.content = "";
This.selectedindex = 0;
This.init ();
}
Passwordstrength.prototype.init = function () {
var s = ' <table cellpadding= ' 0 "id=" ' +this.divname+ ' _table ' cellspacing= ' 0 "style=" width: ' +this.width+ '; height: ' + this.height+ '; ' > ';
s + + ' <tr> ';
for (Var i=0;i<3;i++) {
s + = ' <td id= ' +this.divname+ ' _td_ ' +i+ ' width= ' 33% ' align= ' center ' ><span style= ' font-size:1px ' >& Nbsp;</span><span id= "' +this.divname+ ' _label_ ' +i+ '" style= "Display:none;font-family:courier New, Courier, Mono;font-size:12px;color: #000000; " > ' +this.labels[i]+ ' </span></td> ';
}
s + + ' </tr> ';
s + + ' </table> ';
This.content = s;
if (this.showed) {
document.write (s);
This.copytostyle (This.selectedindex);
}
}
Passwordstrength.prototype.copytoobject = function (O1,o2) {
for (var i in O1) {
O2[i] = O1[i];
}
}
Passwordstrength.prototype.copytostyle = function (ID) {
This.selectedindex = ID;
for (Var i=0;i<3;i++) {
if (i = = id-1) {
this.$ (this.divname+ "_label_" +i). style.display = "inline";
}else{
this.$ (this.divname+ "_label_" +i). Style.display = "None";
}
}
for (Var i=0;i<id;i++) {
This.copytoobject (this.styles[id],this.$ (this.divname+ "_td_" +i). Style);
}
for (; i<3;i++) {
This.copytoobject (this.styles[0],this.$ (this.divname+ "_td_" +i). Style);
}
}
passwordstrength.prototype.$ = function (s) {
return document.getElementById (s);
}
Passwordstrength.prototype.setsize = function (w,h) {
This.width = W;
This.height = h;
}
Passwordstrength.prototype.setminlength = function (n) {
if (isNaN (n)) {
return;
}
n = number (n);
if (n>1) {
This.minlength = n;
}
}
Passwordstrength.prototype.setstyles = function () {
if (Arguments.length = = 0) {
return;
}
for (Var i=0;i<arguments.length && i < 4;i++) {
This.styles[i] = arguments[i];
}
This.copytostyle (This.selectedindex);
}
Passwordstrength.prototype.write = function (s) {
if (this.showed) {
return;
}
var n = (s = = ' string ')? this.$ (s): s;
if (typeof (N)!= "Object") {
return;
}
n.innerhtml = this.content;
This.copytostyle (This.selectedindex);
}
Passwordstrength.prototype.update = function (s) {
if (S.length < This.minlen) {
This.copytostyle (0);
Return
}
var ls =-1;
if (S.match (/[a-z]/ig)) {
ls++;
}
if (S.match (/[0-9]/ig)) {
ls++;
}
if (S.match (/. [ ^a-z0-9]) (/ig)) {
ls++;
}
if (S.length < 6 && ls > 0) {
ls--;
}
Switch (LS) {
Case 0:
This.copytostyle (1);
Break
Case 1:
This.copytostyle (2);
Break
Case 2:
This.copytostyle (3);
Break
Default
This.copytostyle (0);
}
}
</script>
reg.php
<?php
$a = "Wyjboy";
if ($a = = "$usr") {
echo 0;
}else{
Echo 1;
}
?>