Callum Stew
Callum Stew

Reputation: 5

some php scripts not working on raspberry pi web server

Hi i am trying to make a website to host on my raspberry pi. it is running Apache2 and php 5.6.3. here are the script that runs fine:

    <!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>

But when i add this:

    <?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";
        }
    ?>

The screen says: This page is not working 192.168.0.16 is currently unable to handle this request http error 500

It would be great if you could help.

Upvotes: 0

Views: 433

Answers (1)

T Schi
T Schi

Reputation: 106

You have to set a semicolon (;) after the variable initialization. To debug easier, you can set a value in your php.ini file or via the ini_set() function for debug and error information (ini_set('display_errors', 1); And dont forget your semicolon at the end of each line ;)

Upvotes: 1

Related Questions