<?php
//create a session  -CHECK
//create database/table with at least two fields username and password
//add a few usernames and password to the table
//get data from form
//connect to the database
//write an an sql query that compares
$sql = $dbh->prepare("select id from users where username = '$username' and password = '$password'");
$sql->execute();
$numofrecords= $sql->rowCount();
//will give you a 0 if none. 1 or more if they exist
//if statement for if $numofrecords > 0
//then set session for authentication
//else show form and print out a response

//LAST STEP protect your midterm



?>




<form action="login.php" method="post">
Username <input type="text" name="username"/><br>
Password <input type="text" name="password"/>
    <input type="submit" name="submit" value="Log In">
</form> 