2015-06-27 54 views
-4

我有一個表格將會話發回我的索引頁面。基於這些會話,我使用echo從結果中加載模態窗口。我不斷收到500錯誤。我無法弄清楚爲什麼。「如果」聲明和會話

if($_SESSION["submitemail"] == "fail"){ 

    echo 
     "<script type='text/javascript'> 
      $(window).load(function(){ 
       $('#betaalert').modal('show'); 
      }); 
     </script> 


     <div class='modal fade' role='dialog' id='formerror'> 
      <div class='modal-dialog'> 

      <!-- Modal content--> 
      <div class='modal-content'> 
       <div class='modal-header'> 
       <button type='button' class='close' data-dismiss='modal'>&times;</button> 
       <h4 class='modal-title'>Could not send message...</h4> 
       </div> 
       <div class='modal-body'> 
       <? 
       echo '<p>We are very sorry, but there were error(s) found with the form you submitted.</p>'; 
       echo '<p>These errors appear below.</p><br /><br />'; 
       echo $_SESSION['errormessage'].'<br /><br />'; 
       echo '<p>Please go back and fix these errors.</p><br /><br />'; 
       ?> 
       </div> 
       <div class='modal-footer'> 
       <a href='#' class='btn btn-primary' data-dismiss='modal'>Close</a> 
       </div> 
      </div> 

      </div> 
     </div>"; 

} 

else if($_SESSION["submitemail"] == "success"){ 

    echo 
     "<script type='text/javascript'> 
      $(window).load(function(){ 
       $('#betaalert').modal('show'); 
      }); 
     </script> 

     <!-- Modal --> 
     <div class='modal fade' role='dialog' id='formsent'> 
      <div class='modal-dialog'> 

      <!-- Modal content--> 
      <div class='modal-content'> 
       <div class='modal-header'> 
       <button type='button' class='close' data-dismiss='modal'>&times;</button> 
       <h4 class='modal-title'>Thank You <? echo $_POST['first_name']; ?> <? echo $_POST['last_name']; ?>!</h4> 
       </div> 
       <div class='modal-body'> 
       <? 
       echo '<p>We appreciate your business and will be contacting you as soon as possible. Please allow 48 hours for us to process your request before sending another. Thank you!/p>'; 
       ?> 
       </div> 
       <div class='modal-footer'> 
       <a href='#' class='btn btn-primary' data-dismiss='modal'>Close</a> 
       </div> 
      </div> 

      </div> 
     </div>"; 

} 

else { 

    echo 
     "<script type='text/javascript'> 
      $(window).load(function(){ 
       $('#betaalert').modal('show'); 
      }); 
     </script> 

     <!-- Modal --> 
     <div class='modal fade' role='dialog' id='betaalert'> 
      <div class='modal-dialog'> 

      <!-- Modal content--> 
      <div class='modal-content'> 
       <div class='modal-header'> 
       <button type='button' class='close' data-dismiss='modal'>&times;</button> 
       <h4 class='modal-title'>ANNOUNCEMENT!</h4> 
       </div> 
       <div class='modal-body'> 
       <p>However we are pleased to announce that our beta testing program is open to all ambulance companies interested. If you are interested use the contact form on the bottom of this page to send us a message with your contact information and we will get you started with testing ASAP!</p> 
       </div> 
       <div class='modal-footer'> 
       <a href='#' class='btn btn-primary' data-dismiss='modal'>Close</a> 
       </div> 
      </div> 

      </div> 
     </div>"; 

} 
+1

我想在瀏覽器端有500個錯誤 - 服務器端有什麼?也許你應該打開錯誤報告,看看有什麼確切的問題,並在這裏發佈? – jjczopek

+0

而這不是完整的php文件。至少你會發布完整的PHP頁面,以找出哪裏是錯的.. –

回答

0

沒關係,我想通了!謝謝你,未來,我會確保發佈更多信息。