steven_elvisda Posted September 26, 2010 Share Posted September 26, 2010 Hi All, I new with phpfreaks. I have some problem with my php code that i was typping from my php and mysql book. the problem is when i register completedi got the link but the code can not generate uid= but token variable is generated http://localhost:81/user/verify.php?uid=&token=7S9VA Please kindly to check attached file for viewing the full code. I really appreciate with your helping. Kindly Regards, Steve. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/ Share on other sites More sharing options...
inversesoft123 Posted September 26, 2010 Share Posted September 26, 2010 Quick check.. have you registered session for user ? session start() ? Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1115833 Share on other sites More sharing options...
steven_elvisda Posted September 28, 2010 Author Share Posted September 28, 2010 Hi, No sir. the session_start(); and header('Cache-control: private'); for continue captcha session only. thanks Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1116745 Share on other sites More sharing options...
PFMaBiSmAd Posted September 28, 2010 Share Posted September 28, 2010 In order to generate and return the userId, the query in the public function save(){} in the class User must execute without error. In briefly looking at it, you are missing the closing ) that is part of the VALUES () term. You should echo $query inside that function to see exactly what it contains and you can echo mysql_error() to find out why your query is failing. Edit: Your public function setInactive(){} also needs some error checking logic in it. You are calling $this->save(); (which in the current code is returning a false value), but you are not checking that and blindly executing the INSERT INTO %sPENDING ... query. You should not be executing that query unless $this->save() returns a true value. Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1116760 Share on other sites More sharing options...
steven_elvisda Posted September 29, 2010 Author Share Posted September 29, 2010 Hi, Many thanks for your help I just add more ) at VALUE my $this->userId is turned but when I click on verify.php link I alway get file by the last condition (Your Provided invalid data. Please try again.) please check on file verify.php. I apologize that i did not change or add mor condition in function setInactive(){} because that code i typing follow my book. Thanks for your helping and comment. your comment really mean to me. Kindly Regards, Steve. Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1117259 Share on other sites More sharing options...
PFMaBiSmAd Posted September 29, 2010 Share Posted September 29, 2010 The other query in the public function save(){} is missing quotes around the EMAIL_ADDR = "%s" value. Again, you can troubleshoot what you code is doing by echoing the $query variable and echoing mysql_query() to find out what the query looks like and what errors it produces. Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1117312 Share on other sites More sharing options...
steven_elvisda Posted September 30, 2010 Author Share Posted September 30, 2010 Hi PFMaBiSmAd, Many thanks for your help. I really damn with php. Quote Link to comment https://forums.phpfreaks.com/topic/214420-asking-for-help/#findComment-1117568 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.