Re: If (!$submit)

From: Date: Thu, 17 May 2001 14:02:24 +0000
Subject: Re: If (!$submit)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53237@lists.php.net to get a copy of this message
Two suggestions: Use if (!isset($submit)) OR change the order around <?php if ($submit) { // Results of login form, including login failed or successful print() } else { // First html page containing login form } ?> kind regards, bill hollett Tarrant Costelloe wrote: > When using: > > <?php if (!$submit) > { > // First html page containing login form > } > else > { > // Results of login form, including login failed or successful print() > } > >? > > I get an error on line one, due to it at first not recognising the variable > $submit. If I ignore this and continue to fill in the form, on the clicking > the submit button I am then delivered to the same page of which it shows the > results. > > So the only problem being, is when you first go to the page you get: > > Warning: Undefined variable: submit in C:\Documents and Settings\Tarrant > Costelloe\Desktop\locahost\default.php on line 1 > > then the form, on which being filled in and submitted brings you back to the > page without the message and a print() of whether login successful or not. > How do I get rid of the original error? > > Tarrant Costelloe > Web Developer > InsurE-com Ltd. > ------------------------------------ > Office Tel: +44 (0)1273 852014 > Mobile: +44 07714087114 > tcostelloe@insur-e.net > http://www.insur-e.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#53237) next »