Jump to content


Photo

Referrer and Int Increase


  • Please log in to reply
2 replies to this topic

#1 ImJustBrndn

ImJustBrndn
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 28 August 2006 - 01:26 AM

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

#2 jvalarta

jvalarta
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts

Posted 28 August 2006 - 02:27 AM

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.

#3 ImJustBrndn

ImJustBrndn
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 28 August 2006 - 06:06 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users