Jump to content

Asking for Help


steven_elvisda

Recommended Posts

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

 

Please kindly to check attached file for viewing the full code.

I really appreciate with your helping.

 

Kindly Regards,

Steve.

 

[attachment deleted by admin]

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.