I am writing an online soccer (football) management simulator and its coming along really well. However, my code is getting choked up when i ask the user for information such as the registration page.
I have a few text boxes which the user enters their information (name, team name, stadium name etc) and then this information is POST to another page to process it.
At the moment the code i have to check that none of the values are NULL is:
if ($teamname == NULL||$stadiumname == NULL||$managername == NULL)
howver this way i cant find exactly which variable has the null value and i really dont want to test each of them separatly like this:
if ($teamname == NULL) {
echo "Teamname is null";
} else if ($stadiumname == NULL) {
echo "Stadiumname is null";
}
if anybody knows an easy way to quickly test the variables for null values and then returns the variable that is a null value could you please help me
thanks in advance