monkeybidz Posted March 17, 2007 Share Posted March 17, 2007 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 More sharing options...
najibk Posted March 17, 2007 Share Posted March 17, 2007 I would probably have PHP echo it into a Javascript variable, then create a function that initiates onSubmit for the button. Otherwise, without ajax you'd have to create an intermediate page that does what you want, then redirect to your next page. Link to comment https://forums.phpfreaks.com/topic/43130-getting-html-form-variables-in-php/#findComment-209520 Share on other sites More sharing options...
monkeybidz Posted March 17, 2007 Author Share Posted March 17, 2007 I dont have a clue on how to create the 2nd onSubmit function. The echo i have tried before, but does not work like so: <? echo $grandtotal; ?> & <? echo $curid; ?> Was that correct? Link to comment https://forums.phpfreaks.com/topic/43130-getting-html-form-variables-in-php/#findComment-209583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.