[FX.php List] Edit form and if statements

Tim 'Webko' Booth tim at nicheit.com.au
Sun Feb 21 20:10:42 MST 2010

On 22/02/2010, at 2:05 PM, Jon & Jane Montgomery wrote:

> Please enlighten me on this. They are entering data such as their  
> school
> name, believe it or not some don't bother to put that.  I do use  
> spry for
> that but somehow I forgot on the page in question.
> Jon Montgomery
> On 2/21/10 8:56 PM, "Tim 'Webko' Booth" <tim at nicheit.com.au> wrote:
>> Then I also check stuff in php on the handling page, as people can
>> turn JavaScript off and avoid the immediate checking.

Simple case - let's just have a text field.

Obviously we can use Spry to say "Fill out your school name, dumkopff"  
- but if they have JacaScript turned off or you forgot, then we should  
test for the existence of the value on the handling page. Long version  
of the check:

$_SESSION['error'] = "";
if (isset($_POST['school']) $$ $_POST['school'] != "") {
	echo "All is well";
	//Do all our normal stuff
} else {
	$_SESSION['error'] = "No school name";
	header['Location: input.php'];

And check for the existence of the session variable and echo it out to  
the page if required...



More information about the FX.php_List mailing list