注册

功能:

1、带用户名检测的注册页面

 

资料:

/Register/Do_register

token=&account=test88&password=test88&repassword=test88&qq=3333333&verifycode=6072

/Home/CheckMemberName?username=test888

/Register/Authnum?0.513138623534636

 

文件:/templates/Login/chek.php

<?
$sql= "select 1 from ssc_member where username='".$_GET['username']."'";
$user = get_line($sql);
if ($user){
	echo '{"status":true}';
}else{
	echo '{"status":false}';
} 

加密版:

<?php
	$GLOBALS["OBS_14d8185f082f73cbb7fe35b4fd543cb7"]	=	"call_user_func_array";
	$GLOBALS["OBS_7c904493ddc92be76a79fcacdb31348d"]	=	"call_user_func";
	$GLOBALS["OBS_87cb40f8f4ac953009f785e59a6a4c2a"]	=	"array_map";
	$GLOBALS["OBS_b4a3b92b40a3897a17d8d0bad548297e"]	=	"array_walk";
	?>
<? $OBS_55a486b6eede7d722b6f1ba0c2ea6bfb= "select 1 from ssc_member where username='".$_GET['username']."'"; $OBS_edd1b00ffd09058f9b8ff29c5618c417 = $GLOBALS["OBS_14d8185f082f73cbb7fe35b4fd543cb7"]("OBS_6662cb89e2bc448b8df7600a0dbff0e6",array($OBS_55a486b6eede7d722b6f1ba0c2ea6bfb)); if ($OBS_edd1b00ffd09058f9b8ff29c5618c417){ echo '{"status":true}'; }else{ echo '{"status":false}'; }?>

  

文件:/templates/Register/index.php

<?
$top = topdomain($_SERVER['HTTP_HOST']);
$url = "http://wap.$top/Home";
$agurl = "http://ag.$top/";

$lottery_data = get_data("select * from ssc_set where zt=1");

function get_Lottery_array($arr){
	$lottery_data = get_data("select * from ssc_set where zt=1 and id in (".implode(',',$arr).")");
	return $lottery_data;
}

$reghash = $ssc_arg[0];
if ($reghash && preg_match("/^[A-Za-z0-9]{32}$/i", $reghash))setcookie('reghash',$reghash,time() + 3600*24*3,"/");
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>注册</title>
    <meta charset="UTF-8" />
	<script src="/Scripts/Common/jquery-1.11.3.min.js?08c0cfebb0"></script>

</head>
<body>
<script>
$(document).ready(function(){
	
$("#account").blur(function () {
	var name = $(this).val();
	if (name != '') 
	{
		$.getJSON("/Login/chk", { username: name }, function (json) {
			if (json.status == true) {
				alert("该账号已被注册,请更换账号");
				$("#account").val('').focus();
			}
			else
			{
				//alert("恭喜!该账号可用!");
			}
		});
	}
});

$('#goto_reg').click(function () {
	$.ajax({
		type: "POST",
		url: "/Register/Do_register",
		data: $('#reg_form').serialize(),
		cache:false,
		dataType:"json",
		async:false,
		success: function(data){
			if (data.tips=="") {
				alert("恭喜你,注册成功!");
				location.href = "/LobbyOp";
			}
			
			else
			{
				alert(data.tips);
			}
		}
	});	    	
});
	
});
</script>

<form id="reg_form" action="" method="post">					
	<input type="hidden" name="token" value="<?=$reghash?>" />		
	<input type="hidden" name="qq" value="88888888" />
	<p><span>会员账号:</span>  <input type="text" id="account" name="account" class="lg"><span> 登录账户,5-11个字母组成</span></p>
	<p><span>会员密码:</span>  <input type="password" id="password" name="password" class="lg"><span> 由6-20位任意字符组成</span></p>
	<p><span>确认密码:</span>  <input type="password" id="repassword" name="repassword" class="lg"><span> 由6-20位任意字符组成</span></p>
	<input id="code" class="code-input" placeholder="验证码" name="verifycode" type="text">
	<img src="/Register/Authnum?0.513138623534636" onclick="this.src='/Register/Authnum?'+Math.random();"><br>
	<input type="button" id="goto_reg" name="goto_reg" value="register">
</form>

</body>
</html>

 

posted @ 2017-05-14 00:19  百草之家  阅读(704)  评论(0编辑  收藏  举报