开发者

How to get the value of a dropdown menu returned by Paypal?

I'd like to know how to get the value of a dropdown menu with Paypal.

Everything works fine on Paypal's side, exept the fact that I don't know which subscription my members are paying for.

My form is as follow :

    <input type="hidden" name="on0" value="Formula">Formula
    <select name="os0">
        <option value="Basic">Basic €5</option>
        <option value="Standard">Standard €10</option>
        <o开发者_StackOverflowption value="VIP">VIP €20</option>
    </select> 

How can I grab the selected value please ? I guess it's something like :

$_POST['os0']

...But this doesn't work. What am i missing please ?

Any help much apreciated, thanks !


I'm not sure if this is your problem or not, but if you're not using HTTP POST, then the values won't show up in $_POST['os0']. Try using $_REQUEST['os0'] instead and see if you get the values that way.

You can read more about $_POST and $_REQUEST at the PHP docs. You can read about how to set the form submission method at the Mozilla docs:

<!-- Simple form which will send a POST request -->
<form action="" method="post">
  Name: <input type="text" name="name">
  <input type="submit" value="Save">
</form>

<!-- Form with fieldset, legend, and label -->
<form action="" method="post">
  <fieldset>
    <legend>Title</legend>
    <input type="radio" name="radio" id="radio"> <label for="radio">Click me</label>
  </fieldset>
</form>

To learn more about HTTP GET and POST in general, you can read their W3C specifications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜