Advertisement
Guest User

Untitled

a guest
Sep 25th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.56 KB | None | 0 0
  1.  <script type="text/javascript">
  2. function submitt()
  3. {
  4. setTimeout('document.paypal.submit()',1000);
  5. }
  6. </script>
  7.  
  8.  
  9. <?php
  10.  $Amount = $_REQUEST['amount'] ;
  11.  $to = "info.whatzup@gmail.com" ;
  12.  $from = $_REQUEST['email'] ;
  13.  $name = $_REQUEST['Name'] ;
  14.  $headers = "From: $from" . PHP_EOL;
  15.  $subject = "Classified Ad submission";
  16.  
  17.  $fields = array();
  18.  $fields["Name"] = "\nName";  
  19.  $fields["email"] = "\nEmail";
  20.  $fields["Phone"] = "\nPhone";
  21.  $fields["WorkPhone"] = "\nWork Phone";
  22.  $fields["Address"] = "\nStreet Address";
  23.  $fields["City"] = "City";  
  24.  $fields["State"] = "State";
  25.  $fields["Zip"] = "Zip Code";
  26.  $fields["Classification"] = "\nClassification";
  27.  $fields["Ad-Headline"] = "\nHeadline";
  28.  $fields["Other-Classification"] = "\nAlternate Classification";
  29.  $fields["Ad-Content"] = "\nAd Content";
  30.  $fields["Words"] = "\nWord Count";
  31.  $fields["Weeks"] = "\nWeeks to Run";
  32.  $fields["WordCount"] = "\nTotal Words";
  33.  $fields["Rate"] = "\nWord Rate";
  34.  $fields["GrossAmountDue"] = "\nGross Amount";
  35.  $fields["NonProfit"] = "\nNon Profit Ad?";
  36.  
  37.  
  38.  $body = "This Ad has been submitted:\n\n"; foreach($fields as $a => $b){   $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
  39.  
  40.  if($from == '') {print "You have not entered an email, please go back and try again";}
  41.  else {
  42.  if($name == '') {print "You have not entered a name, please go back and try again";}
  43.  else {
  44. $send = mail($to, $subject, $body, "From: Classified-Ad@whatzup.com" . PHP_EOL);
  45.  if($send)
  46.  {print "Thank you $Name, your Ad has been submitted, redirecting to paypal."; echo "<SCRIPT LANGUAGE='javascript'>submitt();</SCRIPT>";}
  47.  else
  48.  {print "Sorry $Name, but we encountered an error sending your form, please notify info.whatzup@gmail.com, or call us at XXXXXXXXXXXXXX."; }
  49.  }
  50. }
  51.  
  52.  
  53.  ?>
  54.  
  55. <form action="https://www.paypal.com/cgi-bin/webscr" id="paypal" onClick="sendtotal()" target="_top" name="paypal" method="post">
  56. <input type="hidden" name="cmd" value="_xclick">
  57. <input type="hidden" name="business" value="XXXXXXXXXXX">
  58. <input type="hidden" name="lc" value="US">
  59. <input type="hidden" name="item_name" value="Classified Ad">
  60. <input type="hidden" name="amount" value="<?php echo $_POST['amount']; ?>" />
  61. <input type="hidden" name="currency_code" value="USD">
  62. <input type="hidden" name="button_subtype" value="services">
  63. <input type="hidden" name="no_note" value="0">
  64. <input type="hidden" name="cn" value="Add special instructions to the seller:">
  65. <input type="hidden" name="no_shipping" value="1">
  66. <input type="hidden" name="shipping" value="0.00">
  67. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement