欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

会员注册验证代码(php+mysql+Ajax)_PHP教程

程序员文章站 2022-05-13 08:25:39
...
会员注册验证代码(php+mysql+Ajax)

会员注册验证代码(php教程+mysql教程+ajax)





会员注册验证代码(php+mysql+ajax)






































请注册会员,只有会员才能发表贴子,游客可以回贴和使用快捷回复功能!
















提示:如果您已经注册了会员,请跳过此步骤,直接点这里





































填写登录名和密码 * 登录名:













* 输入登录密码:


















* 再次输入密码:




































填写个人资料信息 * 邮箱:





















性别:




















出生日期:






















* 验证码:
会员注册验证代码(php+mysql+Ajax)_PHP教程 看不清图片


































* 我已经看过并同意《人民在线论坛网络服务使用协议》














































下面为js文件代码

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 d.p_i_a[j]= new image();
d.p_i_a[j++].src = a[i];
}
}
}
//ajax功能;
function loadajaxelement(e,u,p,f,l){
if(arguments.length 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 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 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 return ;
}
p = $h(p).toquerystring();
new ajax.request(
u,
{method: 'post', parameters: p, onsuccess:s,onfailure: f});
}


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 = '

';
s += '';
for(var i=0;i s += '';
}
s += '';
s += '
';
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 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 this.copytoobject(this.styles[id],this.$(this.divname+"_td_"+i).style);
}
for(;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 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.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 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);
}
}

//reg.php

$a="wyjboy";
if($a == "$usr"){
echo 0;
}else{
echo 1;
}
?>


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/444894.htmlTechArticle会员注册验证代码(php+mysql+Ajax) 会员注册验证代码(php教程+mysql教程+ajax) !doctype html public -//w3c//dtd xhtml 1.0 transitional//en http://www.w3.org/tr/xhtml1...