QQ is added, and the submitted data is not stored. what's the problem? in the recommended registration file, only the user name and password can be entered. I want to add a QQ user, however, QQ is not stored in the table. what is the problem?
You can add users to the backend. you can enter QQ in the backend, and QQ in the backend can be stored in the database.
Code of the promotion link file:
The called JS code:
// {Promote registration function registerBeforSubmit () {var type = $ ('[name = type]: checked', this ). val (); // console. log ($ ('[name = type]: checked', this); if (! This. username. value) throw ('user name not input '); if (! /^ \ W {4, 16} $ /. test (this. username. value) throw ('user name consists of 4 to 16 letters, digits, and underscores '); if (! This. password. value) throw ('Enter the password'); if (this. password. value. length <6) throw ('password must be at least 6'); if (document. getElementById ('cpasswd '). value! = This. password. value) throw ('Two input passwords are different '); if (! This. qq. value) throw ('Do not enter contact QQ');} function registerSubmit (err, data) {if (err) {alert (err );} else {location = '/';}}//}}}
Add user code in the background:
Reply to discussion (solution)
The php code is not posted. I wonder if you have written the value of the QQ field to the database.
/***** Promote registration */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: decrypt ($ userxxx, $ this-> urlPasswordKey); if (! $ This-> getRow ("select uid from {$ this-> prename} members where uid =? ", $ Uid) {// throw new Exception ('The link is invalid! '); $ 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 ('The 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 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?
The database has this value, because QQ can be added in the background, and the promotion Registration Link cannot.
Is the js code for promotion registration not completely pasted, or is the function not fully implemented?
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
Is the js code for promotion registration not completely pasted, or is the function not fully implemented?
No data is written to the table.
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
I don't understand. can you explain it?
'parentId'=>$_POST['parentId'],'parentId'=>$_POST['qq'],
Here is an error. The upstairs is correct.
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
Thank you. here is the error.
'parentId'=>$_POST['parentId'], 'QQ'=>$_POST['qq'],
Thank you. here is the error.
Fix the problem and paste it. otherwise, click it.