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=" HTML; Charset=utf-8 "/>
<link href= "images/css tutorials. 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);