Note that there are some explanatory texts on larger screens.

plurals
  1. POsubmitting a form and then redirecting with hidden variables to paypal?
    primarykey
    data
    text
    <p>I need to submit a form for classified ads on our website when a user clicks the submit button. The price of an ad is based on how many words along with how many weeks it will run so the PayPal button I have reads the hidden "amount" field I have set up. How can I have my form submit and then redirect to PayPal with the hidden amount variable still holding its value? Any other methods would also be welcome. </p> <p>Edit: Ok, I've made my own php script to email the information to me from my original form, I had been using a cgi script my webhost hosted.</p> <p>Now I email myself just fine and I'm trying to find out how to send my hidden variables to paypal from there when I redirect to it. Heres what I'm trying right now. </p> <pre><code>&lt;?php $to = "info.whatzup@gmail.com" ; $from = $_REQUEST['email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "Classified Tests"; $fields = array(); $fields{"Name"} = "Name"; $fields{"email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Address"} = "Street Address"; $fields{"City"} = "City"; $fields{"State"} = "State"; $fields{"Zip"} = "Zip Code"; $fields{"Classification"} = "Classification"; $fields{"Ad-Headline"} = "Headline"; $fields{"Ad-Content"} = "Ad Content"; $fields{"Words"} = "Word Count"; $fields{"Weeks"} = "Weeks to Run"; $fields{"WordCount"} = "Total Words"; $fields{"Rate"} = "Word Rate"; $fields{"GrossAmountDue"} = "Gross Amount"; $fields{"NonProfit"} = "Non Profit Ad?"; $item_name = $_POST['item_name']; $amount = $_POST['amount']; $currency_code = $_POST['currency_code']; $no_shipping = $_POST['item_number']; $shipping = $_POST['item_number']; $cmd = $_POST['cmd']; $bn = $_POST['bn']; $no_note = $_POST['item_number']; $lc = $_POST['lc']; $business = $_POST['business']; $body = "This Ad has been submitted:\n\n"; foreach($fields as $a =&gt; $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); if($send) {header( "Location: https://www.paypal.com/cgi-bin/webscr" );} else {print "We encountered an error sending your mail, please contact us at info.whatzup@gmail.com"; } } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload