Lawrence Cooke
Lawrence Cooke

Reputation: 1597

Paypal Button - Adding Variable to return URL

I am trying to add a simple PayPal button to a website. What I am wanted to do is set up the button to include "options" that need to be selected. This is not a problem, I have the button created and the option select box shows.

What I want to do is return to a URL on my own domain, but have the URL include the selected option from the drop down box that was selected before payment.

so I start at mydomain.com , select an option and after finishing payment have it redirect back to mydomain.com/complete.php?option=theoption

is this possible?

Upvotes: 8

Views: 10120

Answers (1)

ianace
ianace

Reputation: 1635

in php you can add this hidden input in your button

<INPUT TYPE="hidden" NAME="return" value="<?php echo 'mydomain.com/complete.php?option='.$theoption ?>">

where $theoption is the value of theoption that you want to be appended on the return url. Take note that you have to disable payment review so that paypal will automatically redirect back to you website

Upvotes: 17

Related Questions