Added the fill QQ, submit data is not stored, please tell me what's going on

Source: Internet
Author: User
In the recommended registration file can only fill in the user name and password, I would like to add a fill QQ, but QQ is not stored in the table, ask how?

Backstage has added user function, inside there is a can fill QQ, backstage fill QQ can be stored to the database.

Promotion Link File code:


Call the JS code:
{{{{} promote Registration function Registerbeforsubmit () {var type=$ (' [name=type]:checked ', this]. Val ();//console.log ($ (' [Name=type ]:checked ', this)), if (!this.username.value) throw (' No user name entered '), if (!/^\w{4,16}$/.test (This.username.value)) throw (' User name consists of 4 to 16 digits of letters, numbers and underscores '), if (!this.password.value) throw (' Please enter password '), if (this.password.value.length<6) throw (' Password at least 6 bits '), if (document.getElementById (' cpasswd '). Value!=this.password.value) throw (' Two input password is different '); if (!this.qq.value ) throw (' No input contact QQ ');} function Registersubmit (err,data) {if (err) {alert (err);} else{location= '/';}} //}}}


Add the user's code in the background:


Reply to discussion (solution)

PHP code is not posted, I do not know if you have QQ this field value to write to the database

/** * Promotion Register */public final function register ($userxxx) {if (! $userxxx) {//throw new Exception (' Link Error! '); $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::d ecrypt ($userxxx, $this->urlpasswordkey); if (! $this->getrow ("Select UID from {$ This->prename}members where uid=? ", $uid)) {//throw new Exception (' link expires! '); $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 (' Verification code is incorrect. ');} if (!$_post[' ParentID ')) throw new Exception (' link error '); $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 the new Exception (' user '. $para [' username ']. ' " already exists '); 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 ' registration successful ';} Else{throw new Exception (' registration failed ');}} catch (Exception $e) {$this->rollback (); throw $e;}}}


Is this PHP code?

Database has this value, because in the background can add QQ, promote the registration link is not available.

To promote the registration of JS code, is not pasted complete, or the function is not fully implemented?

' ParentID ' =>$_post[' parentid ',            ' QQ ' =>$_post[' QQ '],

To promote the registration of JS code, is not pasted complete, or the function is not fully implemented?
is not to write the data in the table

' ParentID ' =>$_post[' parentid ',            ' QQ ' =>$_post[' QQ '],


I don't understand, can you explain?

' ParentID ' =>$_post[' parentid '], ' parentid ' =>$_post[' QQ ',


It's wrong, upstairs.

' ParentID ' =>$_post[' parentid ',            ' QQ ' =>$_post[' QQ '],


Thanks, it's wrong here.


' ParentID ' =>$_post[' parentid ',            ' QQ ' =>$_post[' QQ '],


Thanks, it's wrong here.

Solve the knot stick, or the total brush out
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.