/** * 推广注册 */ public final function register($userxxx){ if(!$userxxx){ //throw new Exception('链接错误!'); $this->display('team/register.php'); }else{ include_once $_SERVER['DOCUMENT_ROOT'].'/lib/classes/Xxtea.class'; $userxxx=str_replace(array('-','*',''), array('+','/','='), $userxxx); $userxxx=base64_decode($userxxx); $uid=Xxtea::decrypt($userxxx, $this->urlPasswordKey);
if(!$this->getRow("select uid from {$this->prename}members where uid=?",$uid)){ //throw new Exception('链接失效!'); $this->display('team/register.php'); }else{ $this->display('team/register.php',0,$uid); } } } public final function registered(){ if(strtolower($_POST['vcode'])!=$_SESSION[$this->vcodeSessionName]){ throw new Exception('验证码不正确。'); } if(!$_POST['parentId']) throw new Exception('链接错误'); $para=array( 'username'=>$_POST['username'], 'password'=>md5($_POST['password']), 'parentId'=>$_POST['parentId'], 'parentId'=>$_POST['qq'], 'parents'=>$this->getValue("select parents from {$this->prename}members where uid=?",$_POST['parentId']), 'fanDian'=>0, 'fanDianBdw'=>0, 'regIP'=>$this->ip(true), 'regTime'=>$this->time );
* 推广注册
*/
public final function register($userxxx){
if(!$userxxx){
//throw new Exception('链接错误!');
$this->display('team/register.php');
}else{
include_once $_SERVER['DOCUMENT_ROOT'].'/lib/classes/Xxtea.class';
$userxxx=str_replace(array('-','*',''), array('+','/','='), $userxxx);
$userxxx=base64_decode($userxxx);
$uid=Xxtea::decrypt($userxxx, $this->urlPasswordKey);
if(!$this->getRow("select uid from {$this->prename}members where uid=?",$uid)){
//throw new Exception('链接失效!');
$this->display('team/register.php');
}else{
$this->display('team/register.php',0,$uid);
}
}
}
public final function registered(){
if(strtolower($_POST['vcode'])!=$_SESSION[$this->vcodeSessionName]){
throw new Exception('验证码不正确。');
}
if(!$_POST['parentId']) throw new Exception('链接错误');
$para=array(
'username'=>$_POST['username'],
'password'=>md5($_POST['password']),
'parentId'=>$_POST['parentId'],
'parentId'=>$_POST['qq'],
'parents'=>$this->getValue("select parents from {$this->prename}members where uid=?",$_POST['parentId']),
'fanDian'=>0,
'fanDianBdw'=>0,
'regIP'=>$this->ip(true),
'regTime'=>$this->time
);
if(!$para['nickname']) $para['nickname']=$para['username'];
if(!$para['name']) $para['name']=$para['username'];
$this->beginTransaction();
try{
$sql="select username from {$this->prename}members where username=?";
if($this->getValue($sql, $para['username'])) throw new Exception('用户“'.$para['username'].'”已经存在');
if($this->insertRow($this->prename .'members', $para)){
$id=$this->lastInsertId();
$sql="update {$this->prename}members set parents=concat(parents, ',', $id) where `uid`=$id";
$this->update($sql);
$this->commit();
return '注册成功';
}else{
throw new Exception('注册失败');
}
}catch(Exception $e){
$this->rollBack();
throw $e;
}
}
}是这段PHP代码吗?数据库有这个值的,因为在后台可以添加QQ,推广注册链接不可以。
'QQ'=>$_POST['qq'],
'parentId'=>$_POST['parentId'],
'parentId'=>$_POST['qq'],
这里写错了,楼上正解