Q:

How to send custom data to paypal and get it back in return url using post?

The users can pick one of the options from dropdown and pay for it (same cost for all options). The return URL in website preferences is set properly and I do get transaction info as _POST data. The assessments below is a drop-down with few options, how do I pass it paypal and get it back? I tried naming the variable as custom but that didn't work either. What am I doing wrong?
<div class="form-group">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <select class="form-select" id="assessments" name="assessments">
    foreach ($choices as $key => $value) {
      <option value="'.$key.'">'.$value.'</option>
    }
  </select>
  <input type="hidden" name="rm" value="2">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="TESTBUTTONID">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>

A:

Paypal only accepts the variables mentioned in hidden. Here is the following from Paypal website:

HTML input variables in a PayPal PayPal Payments Standard FORM are always hidden from the payer's view. They have the following general format:

Please check this link: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/

