Jump to content

Getting html form variables in php


monkeybidz

Recommended Posts

I have this page mixed html, java and php. The values of the form are in php like so:

 

<?

  $amount = round($amount,2);

 

if($payment_method == "Paypal") {

 

    $sql = "SELECT * FROM `partners_paypal` ";

    $res = mysql_query($sql);

 

    while ($row=mysql_fetch_object($res)) {

        $paypal_email =  stripslashes(trim($row->paypal_email ));

    }

 

 

      $paypalid  =  $paypal_email;

      $grandtotal =  $amount;

 

 

      $mydomain  =  "http://".$_SERVER['SERVER_NAME'];

      $successurl =  $track_site_url."/paymentsuccess.php?type=$type&curid=$curid&amount=$amount&secid=$secid&secpass=$secpass";

      $failurl    =  $track_site_url."/paymentfail.php?curid=$curid";

      $notifyurl  =  $track_site_url."/ipn_notify.php";

 

?>

 

  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal" id="paypal">

  <div align="center"> Connecting To Payment Gateway...<input type="image" src="images/wait.gif"  name="test" value="22"> </div>

    <input type="hidden" name="cmd" value="_xclick">

    <input type="hidden" name="business" value="<?=$paypalid?>">

    <input type="hidden" name="item_name" value="<?=$curid?>">

    <input type="hidden" name="amount" value="<?=$grandtotal?>">

    <input type="hidden" name="currency_code" value="USD">

    <input type="hidden" name="return" value="<?=$successurl?>">

    <input type="hidden" name="notify_url" value="<?=$notifyurl?>">

    <input name="successurl" type="hidden" value="<?=$successurl?>">

    <input name="failurl"  type="hidden" value="<?=$failurl?>">

  </form>

<script language="javascript">

        document.paypal.submit();

  </script>

 

I need to capture $grandtotal & $curid when the submit button is hit in order to send these variables through the script below.

 

<!--begin clixGalore code, copyright 2007 -->

<img src="https://www.clixGalore.com/AdvTransaction.aspx?AdID=7760&SV=<?=$grandtotal?>&OID=<?=$curid?>" height="0" width="0"

border="0">

<!--end clixGalore code -->

 

Can this be done, and if so is placing the script at the bottom of this page correct? I tried placing it in the $successurl page, but PayPal seems to send different variables in place of amount and item_name.

Any help is appreciated.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/43130-getting-html-form-variables-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.