Jump to content

Archived

This topic is now archived and is closed to further replies.

ImJustBrndn

Referrer and Int Increase

Recommended Posts

Ok, with the help of one of the moderators I've gotten most of the bugs worked out, except for two.

I want a confirmation.php page to be able to increase the "quantity" in table "products" by 1 everytime someone completes a paypal transaction, but I only want it to increase it by 1 if the person reaches the page from paypal.com I don't want someone to just be able to go to www.mydomain.com/confirmation.php and it increase the quantity without them paying. I only want it to increase it if the script says ok this person is being referred to this page from paypal, so that means they paid, so I can increase the quantity by one. Is there a way to do this in php, thanks for the help in advance.

Brandon

Share this post


Link to post
Share on other sites
How about something like:

if ($HTTP_REFERER == 'paypal.com/address') {
    //update db
}

I suppose if the referrer address is from paypal, but not always an exact string, you could use strpos() to determine if "paypal.com" is at least in the referring address.

Share this post


Link to post
Share on other sites
Thanks I wasn't for sure there was an action for that. Now as far as where it says //updated db is that actually a command or do I have to put my other stuff in there.

Share this post


Link to post
Share on other sites

×

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.