The question I am asking has been asked here but was asked pretty badly and resulted in the problem not being resolved. What the guy that asked that question is experiencing is exactly what I am experiencing, I assume he is following the same YouTube tutorial as me. Anyway here is all of the PHP / HTML code I have written to far:
<?php
session_start();
?>
<?php
$form = "<form action='./login.php' method='post'>
<table>
<tr>
<td>Username:</td>
<td><input type='text' name='user' /></td>
</tr>
<td>Password:</td>
<td><input type='password' name='password' /></td>
</tr>
<td></td>
<td><input type='submit' name='loginbtn' value='Login'/></td>
</tr>
</table>
</form>";
if ($_POST ['loginbtn']){
$user = $_POST['user'];
$user = $_POST['password'];
if ($user){
if ($password){
echo "$user - $password <hr /> $form";
}
else
echo "you must enter your password $form";
}
else
echo "you must enter your username $form";
}
else
echo $form;
?>
I've tried adding a variable to if ($user){ and if ($password){ but that did nothing. Anyone know what the issue could be?