Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does this php script work fine in firefox but not Safari or Opera?
    primarykey
    data
    text
    <p>I have a script that mails me my form data for a classified ad. Yesterday when I left work it worked fine. Now it is only working in FireFox and I'm getting my "else" statement "We encountered an error sending your mail, please notify XXXX@XX.COM" in both Opera AND Safari which makes no sense to me.</p> <p>What's causing this error, and why does it fail in some browsers but work in others?</p> <pre><code> &lt;script language="javascript"&gt; function submitt() { setTimeout('document.paypal.submit()',1000); } &lt;/script&gt; &lt;?php $to = "XXX@XXX.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) {print "Your Ad has been submitted, redirecting to paypal."; echo "&lt;SCRIPT LANGUAGE='javascript'&gt;submitt();&lt;/SCRIPT&gt;";} else {print "We encountered an error sending your mail, please notify XXX@XXX.com"; } } } ?&gt; &lt;form action="https://www.paypal.com/cgi-bin/webscr" id="paypal" target="_self" name="paypal" method="post"&gt; &lt;input type="hidden" name="cmd" value="_xclick"&gt; &lt;input type="hidden" name="business" value="XXXXXXXXXXXX"&gt; &lt;input type="hidden" name="lc" value="US"&gt; &lt;input type="hidden" name="item_name" value="Classified Ad"&gt; &lt;input type="hidden" name="amount" id="Amount" value=""&gt; &lt;input type="hidden" name="currency_code" value="USD"&gt; &lt;input type="hidden" name="button_subtype" value="services"&gt; &lt;input type="hidden" name="no_note" value="0"&gt; &lt;input type="hidden" name="cn" value="Add special instructions to the seller:"&gt; &lt;input type="hidden" name="no_shipping" value="1"&gt; &lt;input type="hidden" name="shipping" value="0.00"&gt; &lt;input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"&gt; &lt;/form&gt; </code></pre> <p>What's causing this error, and why does it fail in some browsers but work in others?</p>
    singulars
    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.
 

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