2017-04-21 54 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

谢谢你,工作正常。 –