<?php
//include("template.php"); 

$siteName = "Script Login Page";

$currentPage = substr($_SERVER['PHP_SELF'], 1);

        // Inialize session
        session_start();

        // Include database connection settings
        //include('sql.inc');

/*      $conn = mysqli_connect('localhost', 'login', '1qaz2wsx', 'login');

        if (mysqli_connect_errno()) 
        {
                exit('Connect failed: '. mysqli_connect_error());
        }

        mysqli_close($conn);
*/
        // Retrieve username and password from database according to user's input
        //missing sqli statements here

        $password = '21232f297a57a5a743894a0e4a801fc3';
        $username = 'admin';

        // Check username and password match
        //if (mysql_num_rows($login) == 1)
        if (($username == $_POST['username']) && ($password  == md5($_POST['password']))) 
        {
                // Set username session variable
                $_SESSION['username'] = $_POST['username'];
                $_SESSION['isloggedin'] = true;
                // Jump to secured page
                header('Location: index.php');
        }
?>
<!DOCTYPE html>
<html>
<head>
        <link href='http://fonts.googleapis.com/css?family=Lekton' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Marvel' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Sorts+Mill+Goudy' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Shanti' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Andika' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" href="css/reset.css" />
        <link rel="stylesheet" type="text/css" href="css/main.css" />
        <link rel="stylesheet" type="text/css" href="css/form.css" />
        <script language="JavaScript" src="js/hover.js"></script>
        <script language="JavaScript" src="js/jquery.js"></script>
</head>
 <body>
        <header id='header'>
                <p><?php echo $siteName; ?> </p>
        </header>
        <section id='hyperlinks' class='leftlinks'>
        <?php
         include("mid_template.php"); 
         //printSideLinks($currentPage);
         ?>
   
        </section>
        <section id='container'>
                <section id='main' class='content'>
                        <form method="POST" action="login.php">
                                </fieldset>
                                        <fieldset>
                                        <legend><?php echo $siteName; ?>:</legend>
                        <ol>                                    
<!--     START EDITING HTML HERE -->
                            <li><label>Username</label><input type='text' name="username" placeholder='username'/></li>
                            <li><label>Password</label><input type='text' name="password" placeholder='password'/></li>
                            </br>
                        </ol>                                                                                                               
                                <input type='submit' value='Login' />
                        </form>                  
                </section>                       
        </section>     

<?php
include("footer.php")
?>
