After paypal payment want to update user set to "activated" but won't work

Hi! I was wondering if someone could help out with this very stupid and probably very obvious problem I am having.

After a user registers they pay with paypal and come back to the same page on the site and I added this “if statement” to try and update my “users” table so that the “activated” and “IsPaid” field will change from “0” to “1” and thereafter allow the user to be able to login.

[php]if($status == ‘Completed’ || $status == ‘Pending’)
$activate = mysql_query(“UPDATE users SET activated=1, IsPaid=1 WHERE id=’”.$_SESSION[‘lastid’]."’");

header (‘location:’);

This code is not working. Can anybody help me and tell me what I am doing wrong?

thank you

Are you using the paypal ipn service? If not, you should. Based on the code you provided would indicate you are but we will need more of the whole code to help more. What you provided does not show us enough to figure out why it’s not working. If you are not using the ipn, how are you trying to decide if they actually made the payment?

Sponsor our Newsletter | Privacy Policy | Terms of Service