Store username in username field if password is incorrect
How many of the websites that have logins store the username in the username field when the password is entered incorrectly. The form action (it's on index.php) is another php file that, if the password is wrong, uses Header () to return to the index and passes the error to it with a GET. I could use GET to pass the username back to the form, but that seems like a mess and I noticed that sites like SMF forums have a username in the username field without a messy url.
source to share
You can use sessions.
For example, when the message is wrong (this would be in the file handling your post request):
$_SESSION['username'] = $_POST['username'];
Then on the login page:
<input type="text" name="username" value="<?php echo @$_SESSION['username']; ?>" />
Make sure you start a session: http://php.net/session_start
source to share