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