[thelist] field checking in PHP

Martin Kuplens-Ewart martin at takingitglobal.org
Mon Dec 17 22:44:02 CST 2001


Gaaaaah.. Just realised that this is half-baked code!!!

I hate it when I do that... 

Oh. Oops... Was actually just missing the one semicolon... Meh

Corrected code below:

For each of your fields in sequence as below... (where $field1 is
replaced with the name of the variable, and erm, Field1Name is replaced
with the name of the form field (OneWord):

if ($field1)
{
	$check[Field1Name] = 1;
	$checkint .= 1;
}

###############################
# do checking, etc
###############################

if ($checkint > 0 && $checkint < 13)
{
	echo ("The Following fields were left blank:<br>\n");
	foreach ($check as $key => $value)
	{
		echo($key."\n");		
	}
}

Then do the rest of your processing as normal. :)

-m	







More information about the thelist mailing list