Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function submitt()
- {
- setTimeout('document.paypal.submit()',1000);
- }
- </script>
- <?php
- $Amount = $_REQUEST['amount'];
- $to = "info.whatzup@gmail.com";
- $from = $_REQUEST['email'];
- $name = $_REQUEST['Name'];
- $headers = "From: $from" . PHP_EOL;
- $subject = "Classified Ad submission";
- $fields = array();
- $fields["Name"] = "\nName";
- $fields["email"] = "\nEmail";
- $fields["Phone"] = "\nPhone";
- $fields["WorkPhone"] = "\nWork Phone";
- $fields["Address"] = "\nStreet Address";
- $fields["City"] = "City";
- $fields["State"] = "State";
- $fields["Zip"] = "Zip Code";
- $fields["Classification"] = "\nClassification";
- $fields["Ad-Headline"] = "\nHeadline";
- $fields["Other-Classification"] = "\nAlternate Classification";
- $fields["Ad-Content"] = "\nAd Content";
- $fields["Words"] = "\nWord Count";
- $fields["Weeks"] = "\nWeeks to Run";
- $fields["WordCount"] = "\nTotal Words";
- $fields["Rate"] = "\nWord Rate";
- $fields["GrossAmountDue"] = "\nGross Amount";
- $fields["NonProfit"] = "\nNon Profit Ad?";
- $body = "This Ad has been submitted:\n\n";
- foreach ($fields as $a => $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, "From: Classified-Ad@whatzup.com" . PHP_EOL);
- if ($send) {
- print "Thank you $Name, your Ad has been submitted, redirecting to paypal.";
- echo "<SCRIPT LANGUAGE='javascript'>submitt();</SCRIPT>";
- } else {
- print "Sorry $Name, but we encountered an error sending your form, please notify info.whatzup@gmail.com, or call us at XXXXXXXXXXXXXX.";
- }
- }
- }
- <form action="https://www.paypal.com/cgi-bin/webscr" id="paypal" onClick="sendtotal()" target="_top" name="paypal" method="post">
- <input type="hidden" name="cmd" value="_xclick">
- <input type="hidden" name="business" value="XXXXXXXXXXX">
- <input type="hidden" name="lc" value="US">
- <input type="hidden" name="item_name" value="Classified Ad">
- <input type="hidden" name="amount" value="<?php echo $_POST['amount']; ?>" />
- <input type="hidden" name="currency_code" value="USD">
- <input type="hidden" name="button_subtype" value="services">
- <input type="hidden" name="no_note" value="0">
- <input type="hidden" name="cn" value="Add special instructions to the seller:">
- <input type="hidden" name="no_shipping" value="1">
- <input type="hidden" name="shipping" value="0.00">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement