8

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?

Lawrence Cooke
  • 1,567
  • 3
  • 26
  • 52

1 Answers1

17

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

ianace
  • 1,646
  • 2
  • 17
  • 31
  • This solution is not safe. User can change option with inspect element. – Farid Movsumov Mar 01 '15 at 15:58
  • Ferid, yes the user can change the HTML but it has no security risks, the payment flow will not be interrupted. The only difference will be that the user might be redirected to a different page. – Leo Nov 02 '15 at 17:48