ok so i have created a form which checks for empty fields
if (empty($username) || empty($password)) {
include "loginpage.php";
echo "Please fill in all the fields";
} else {
but the problem is that even if i fill in all the fields it still gives my the message.
Check for empty fields script
Moderator: General Moderators
Re: Check for empty fields script
What's the whole script?
Re: Check for empty fields script
It would be better to see a bit more of the script but try this:
Code: Select all
if(!isset($_POST['username']) || !isset($_POST['password'])){
echo "Please fill in all the fields";
}else{
........