PHP显示空白的inf IE&;Firefox,但不是Safari


PHP shows up blank inf IE & Firefox but not Safari

我是php&有一个简单的"告诉朋友"代码。假设弹出窗口&显示消息已发送给朋友。这在Safari中效果很好,但在IE&Firefox。

以下是代码:

<?php
if(isset($_POST['email'])) {
$email_to = "speedyblindsdfw@gmail.com";
$email_subject = "Check this site out!"; 
function died($error) {
    //error code 
    echo "We are very sorry, but there were error(s) found with the form you submitted. ";
    echo "These errors appear below.<br /><br />";
    echo $error."<br /><br />";
    echo "Please go back and fix these errors.<br /><br />";
    die();
  }
  // validation expected data exists
  if(!isset($_POST['senders_email']) ||
    !isset($_POST['email'])) {
    died('We are sorry, but there appears to be a problem with the form you submitted.');       
  }
$email_from = $_POST['senders_email']; // required
$email = $_POST['email']; // not required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+'.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
 function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}
$email_message .= "I was on this site today & thought you would be interested.";
$email_message .= "'nwww.primaresidential.com'n'n";
$email_message .= "Dear " .clean_string($email). ",";       
$email_message .= "'nYour friend, " .clean_string($email_from). " had linked";
$email_message .= "our site to your email, we hope you enjoy our site as much as they did!"; 
$email_message .= "'n'nPrima Residential Services."; 
//email headers
$headers = 'From: '.$email_from."'r'n".
'Reply-To: '.$email_from."'r'n" .
'X-Mailer: PHP/' . phpversion();    
 @mail($email_to, $email_subject, $email_message, $headers);
 @mail($email, $email_subject, $email_message, $headers);  
 ?>
  <!----HTML CODE------>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>PrimaResidential Serivces- Emailer</title> 
       <style type="text/css" media="all">@import "css/style.css";</style>  
       <style type="text/css" media="all">@import "css/style.css";</style>

      </head>
    <br/><br/><br/><br/><br/>
        <div class="boxbg all-round" id="page-container-Popup">
        <br/><br/><br/><br/><br/><center>
        <h2>Your email was successfully sent.</h2><br>
        <br><h3>Thank you for spreading the word.<br>
           <font size="1"> Be sure to check your email in the next 2-3 business days for a little surprise.</font></h3>
        <br/></center>
        </div>
        <a href="javascript:window.close()">Close Window</a>      

     </body>
     </html>
     <?php
      }
     ?>

如果你看到我做错了什么或我需要补充什么,请告诉我。感谢:)

您没有包含<body>标记,因此浏览器不得不猜测。您还将两次导入同一样式表。过多的<br>标签可能会将实际内容从屏幕底部推掉,或者如果元素中有overflow:hidden,则会将其推掉。总的来说,你有很多问题,我建议你解决,看看这是否有帮助。

相关文章: