I want to check if the user has entered a username or not, this code does not work, why and what should i have?
if (!isset($_POST['username'])){ echo "You have not entered a username<br>"; $err = 1; }
empty()
In other words, simply not entering a username won't make [man]isset/man return false, since the form element will still be set (an empty/null value is a perfectly acceptable/settable value).