Checking is field is empty
Posted: Wed Mar 30, 2011 1:07 pm
HI,
im trying to check whether fields on my html page are empty. If they are i want a message to appear saying "youve not filled in all fields...etc." if they have filled it in then carry out the php. the code i have is:
This code doesnt print the error if they leave the fields empty please advise!
Thanks,
Mike

im trying to check whether fields on my html page are empty. If they are i want a message to appear saying "youve not filled in all fields...etc." if they have filled it in then carry out the php. the code i have is:
Code: Select all
else if(is_null($firstname) || is_null($surname) || is_null($line1) || is_null($line2)|| is_null($country) || is_null($postcode) || is_null($telephonenumber) || is_null($cardhldname) || is_null($cardnumber) || is_null($country) || is_null($postcode) || is_null($telephonenumber) || is_null($cardhldname) || is_null($cardType) || is_null($securitynumber))
{
print ("Please make sure that all your fields have been filled in. Thank You.");
}
else{
do this code....
}
Thanks,
Mike