时间:2021-07-01 10:21:17 帮助过:20人阅读
//{{{推广注册function registerBeforSubmit(){ var type=$('[name=type]:checked',this).val(); //console.log($('[name=type]:checked',this)); if(!this.username.value) throw('没有输入用户名'); if(!/^\w{4,16}$/.test(this.username.value)) throw('用户名由4到16位的字母、数字及下划线组成'); if(!this.password.value) throw('请输入密码'); if(this.password.value.length<6) throw('密码至少6位'); if(document.getElementById('cpasswd').value!=this.password.value) throw('两次输入密码不一样'); if(!this.qq.value) throw('没有输入联系QQ');}function registerSubmit(err,data){ if(err){ alert(err); }else{ location='/'; }}//}}}
php代码没贴出来,不知道你有没有把QQ这个字段的值写到数据库
/** * 推广注册 */ 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; } }}
推广注册的js代码,是没有粘贴完整,还是功能没有全部实现?
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
推广注册的js代码,是没有粘贴完整,还是功能没有全部实现?
是不往表里写数据
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
'parentId'=>$_POST['parentId'],'parentId'=>$_POST['qq'],
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],