PHP代码行不能使用html表单! 500错误

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
    <title>MechRook</title>
    <link type="text/css" rel="stylesheet" href="css.css"/>
    <link type="image/jpeg" rel="short icon" href="favicon.jpg"/>
</head>
<body>
    <div id="fheader">
        <h1>Account</br></h1>
        <?php
        $form = '<form method="post" action="index.php">
            Username: <input name="user" type="text"></br>
            Password: <input name="pass" type="password"></br>
            <input name="btn" type="submit" value="Login">
        </form>';
        if ($_POST['btn']) {
            $user = $_POST['user'];
            $pass = $_POST['pass'];

            if ($user) {
                if($pass) {
                    echo "$user - $pass <hr> $form";
                }
                else {
                    echo "You must enter your password. $form";
            }
            else {
                echo "You must enter your username. $form";
            }   
        }
        else {
            echo $form;
        }
        ?>
        <h2>Account:</br><?php echo $_POST['user']; ?></h2>
    </div>
    <div id="sheader">
        <h1 style="font-size:50px">MechRook</h1>
        <section id="con">
            <div class="button">
                <a href="index.html" class="link">Home</a>
            </div>
            <div class="button">
                <a href="account.html" class="link" style="font-size:15px">Account</a>
            </div>
            <div class="button">
                <a href="contact.html" class="link">Contact</a>
            </div>
        </section>
        <h2>
            </br></br>Welcome to MechRook
        </h2>
        <p>
            Welcome to MechRook! MechRook is currently nothing. Wow what a waste of a URl, you might think that but you will see. My friends and I have big plans for MechRook. We have multiple designers for website templates and coders.
        </p>
    </div>
</body>
</html>

It gives me a 500 ERROR. I am trying to make a form! Please Help! Tell me what I can do. Thanks!________________________________________________________________________________________________________________

I'm not a PHP programmer (I do JS, and I'm relatively new at it), but right away I see you're missing a closing bracket. The page will display with this code:

if ($_POST['btn']) {
        $user = $_POST['user'];
        $pass = $_POST['pass'];

        if ($user) {
            if($pass) {
                echo "$user - $pass <hr> $form";
            } else {
                echo "You must enter your password. $form";
            }
        } else {
            echo "You must enter your username. $form";
        }   
    } else {
        echo $form;
    }

I tested in at a server after adding the missing bracket, it works fine so just try this new code (it doesn't have messy if-else conditions):

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
    <title>MechRook</title>
    <link type="text/css" rel="stylesheet" href="css.css"/>
    <link type="image/jpeg" rel="short icon" href="favicon.jpg"/>
</head>
<body>
    <div id="fheader">
        <h1>Account</br></h1>
        <?php
        $form = '<form method="post" action="'.$_SERVER['PHP_SELF'].'">
            Username: <input name="user" type="text"></br>
            Password: <input name="pass" type="password"></br>
            <input name="btn" type="submit" value="Login">
        </form>';
        if ($_POST['btn']) {
            $user = $_POST['user'];
            $pass = $_POST['pass'];

            if (($user) && !($pass)) {
                echo "You must enter your password. $form";
            }
            else if (!($user) && ($pass)) {
                echo "You must enter your username. $form";
            }
            else if (!($user) && !($pass)){
                echo "You must enter your username and your password. $form";
            }
            else {
                echo "$user - $pass <hr> $form";
            }

        }
        else {
            echo $form;
        }
        ?>
        <h2>Account:</br><?php echo $_POST['user']; ?></h2>
    </div>
    <div id="sheader">
        <h1 style="font-size:50px">MechRook</h1>
        <section id="con">
            <div class="button">
                <a href="index.html" class="link">Home</a>
            </div>
            <div class="button">
                <a href="account.html" class="link" style="font-size:15px">Account</a>
            </div>
            <div class="button">
                <a href="contact.html" class="link">Contact</a>
            </div>
        </section>
        <h2>
            </br></br>Welcome to MechRook
        </h2>
        <p>
            Welcome to MechRook! MechRook is currently nothing. Wow what a waste of a URl, you might think that but you will see. My friends and I have big plans for MechRook. We have multiple designers for website templates and coders.
        </p>
    </div>
</body>
</html>

Hope it works.