I am trying to create a simple text field login but am struggling
Can someone tell me what is wrong with this? The password is simply 'password'
Code:
<?php
session_start();
if($_POST){
$_SESSION['username']=$_POST["loginpass"];
}
if(!$_SESSION['username'] == "password"){
echo "You are not authenticated. Please login.<br><br>
<form action='index.php' method='post'>
<input type='password' name='loginpass' />
<input type='submit' value='log in' />
</form>";
}
else
{
echo "logged in, <a href='admin.php'>continue to admin page</a>";
}
?>
Can someone tell me what is wrong with this? The password is simply 'password'