title: integrate paypal payment gateway with Select php
body: <p>Hello everyone i have been trying to add paypal payment system in my website 
  but when ever i click submit it reset the selected value and choose the first one then submit to paypal.
  Here i want it to submit the correct chosen <code>option</code>. i tied few method but failed.
  i hope anyone will help me to solve this problem.
  i want it to submit the correct chosen option in <code>Select</code>. But it submits only first one. please modify the code and comment :)  </p>
  
  <pre><code>&lt;form id='paypal-info' method='post' action='#'&gt;
  
      FACEBOOK_ID&lt;/br&gt;
      &lt;input name="fbid" value="" /&gt;&lt;/br&gt;
  
      &lt;select class="form-control" value="" name="mode" id="mode"&gt;
          &lt;option value="gems"&gt;1300 Gems $5.00 USD&lt;/option&gt;
          &lt;option value="gems1"&gt;3000 Gems $10.00 USD&lt;/option&gt;
          &lt;option value="gems2"&gt;8000 Gems $25.00 USD&lt;/option&gt;
          &lt;option value="gems3"&gt;17000 Gems $50.00 USD&lt;/option&gt;
          &lt;option value="gems4"&gt;36000 Gems $100.00 USD&lt;/option&gt;
          &lt;option value="gems5"&gt;76000 Gems $200.00 USD&lt;/option&gt;
      &lt;/select&gt;
  
      &lt;input type='submit' name='pay_now' id='pay_now' value='Pay' /&gt;
  &lt;/form&gt;
  &lt;?php
  
  if(isset($_POST['pay_now'])){
      $data=array(
          'merchant_email'=&gt;'c1296562@opayq.com',
          'currency_code'=&gt;'USD',
          'thanks_page'=&gt;"http://mywebsite/tools/success.php",
          'notify_url'=&gt;"http://mywebsite/tools/cancel.php",
          'cancel_url'=&gt;"http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
          'paypal_mode'=&gt;true,
      );
      if($_POST['mode'] = gems) {
          $product_name = "1300 Gems";
          $amount = "5.00";
      }elseif($_POST['mode']=gems1){
          $product_name = "3000 Gems";
          $amount = "10.00";
      }elseif($_POST['mode']=gems2){
          $product_name = "8000 Gems";
          $amount = "25.00";
      }elseif($_POST['mode']=gems3){
          $product_name = "17000 Gems";
          $amount = "50.00";
      }elseif($_POST['mode']=gems4){
          $product_name = "36000 Gems";
          $amount = "100.00";
      }elseif($_POST['mode']=gems5){
          $product_name = "76000 Gems";
          $amount = "200.00";
      }
  
  $fbid=$_POST['fbid'];
      echo infotutsPaypal($data,$product_name,$amount,$fbid);
  
  }
  
  function infotutsPaypal( $data,$product_name,$amount,$fbid) {
  
      define( 'SSL_URL', 'https://www.paypal.com/cgi-bin/webscr' );
      define( 'SSL_SAND_URL', 'https://www.sandbox.paypal.com/cgi-bin/webscr' );
  
      $action = '';
      //Is this a test transaction?
      $action = ($data['paypal_mode']) ? SSL_SAND_URL : SSL_URL;
  
      $form = '';
  
      $form .= '&lt;form name="frm_payment_method" action="' . $action . '" method="post"&gt;';
      $form .= '&lt;input type="hidden" name="business" value="' . $data['merchant_email'] . '" /&gt;';
      // Instant Payment Notification &amp; Return Page Details /
      $form .= '&lt;input type="hidden" name="notify_url" value="' . $data['notify_url'] . '" /&gt;';
      $form .= '&lt;input type="hidden" name="cancel_return" value="' . $data['cancel_url'] . '" /&gt;';
      $form .= '&lt;input type="hidden" name="return" value="' . $data['thanks_page'] . '" /&gt;';
      $form .= '&lt;input type="hidden" name="rm" value="2" /&gt;';
      // Configures Basic Checkout Fields --&gt;
      $form .= '&lt;input type="hidden" name="lc" value="" /&gt;';
      $form .= '&lt;input type="hidden" name="no_shipping" value="1" /&gt;';
      $form .= '&lt;input type="hidden" name="no_note" value="1" /&gt;';
      // &lt;input type="hidden" name="custom" value="localhost" /&gt;--&gt;
      $form .= '&lt;input type="hidden" name="currency_code" value="' . $data['currency_code'] . '" /&gt;';
      $form .= '&lt;input type="hidden" name="item_name" value="'.$product_name.'" /&gt;';
      $form .= '&lt;input type="hidden" value="_xclick" name="cmd"/&gt;';
      $form .= '&lt;input type="hidden" name="amount" value="'.$amount.'" /&gt;';
      $form .= '&lt;input type="hidden" name="page_style" value="paypal" /&gt;';
      $form .= '&lt;input type="hidden" name="charset" value="utf-8" /&gt;';
      $form .= '&lt;input type="hidden" name="on1" value="'.$fbid.'"&gt;';
    $form .= '&lt;script&gt;';
      $form .= 'setTimeout("document.frm_payment_method.submit()", 1);';
     $form .= '&lt;/script&gt;';
      $form .= '&lt;/form&gt;';
      return $form;
  }
  ?&gt;
  </code></pre>