2017-04-21 113 views
0

嗨,我想做一個網站來託管我的覆盆子pi。它運行Apache2和PHP 5.6.3。這裏是運行正常的腳本:一些PHP腳本不能在樹莓派網絡服務器上工作

<!DOCTYPE html> 
    <html> 
     <head> 
      <title>Callums Smarthouse</title> 
      <link rel="stylesheet" type="text/css" href="style.css"> 
     </head> 
     <body> 
      <?php include("header.php");?> 
       <li><a class="active" href="index.php">Home</a></li> 
       <li><a href="alarm.php">Alarm</a></li> 
       <li><a href="cammera.php">Cammera</a></li> 
       <li><a href="automation.php">Home Automation</a></li> 
       <li><a href="settings.php">Settings</a></li> 
       <li class="logout"><a href="logout.php">Log out</a></li> 
      <?php include("header2.php");?> 
      <div> 
       <center> 
        <form action="index.php"> 
         <input type="submit" value="Click to continue" /> 
        </form> 
       </center> 
      </div> 
      <?php include("footer.php");?> 
     </body> 
    </html> 

但當我補充一點:

<?php 
     $mypass="password" 
     $passcheck=$_POST["password"] 
     if($passcheck==$mypass){ 
      echo"Welcome, ".$_POST["username"].". You are now logged in.</br>"; 
     } 
     else{ 
      echo"Sorry the rong password was entered. Please try again"; 
     } 
    ?> 

屏幕說: 該頁面無法正常工作 192.168.0.16目前無法處理此請求 http錯誤500

如果你能幫忙,這將是非常好的。

+0

Missing';'s ... –

回答

1

您必須在變量初始化後設置一個分號(;)。 爲了更容易調試,你可以在你的php.ini文件中設置一個值,或者通過ini_set()函數設置調試和錯誤信息(ini_set('display_errors', 1);並且不要忘記你在每行末尾的分號;)

+0

謝謝你,工作正常。 –

相關問題