2015-06-27 56 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

没关系,我想通了!谢谢你,未来,我会确保发布更多信息。