Re: beginning PHP problem
- From: Geoff Berrow <blthecat@xxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 07:55:46 +0100
Message-ID: <1143524859.916294.266550@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> from
Duderino82 contained the following:
first the esxpression in the if is wrong.
if (isset($submit) && $submit=="yes")
could be a typo ...anyway you might want to considere the fact that
only the second condition is necessary(if the 2° is true will allways
be true even the 1°)
If you have full error reporting on (which you should), doing that will
generate an undefined variable notice.
Actually, the main problem is in the form tag. :-)
It should read:
<?php
error_reporting(E_ALL);
if (isset($_POST['submit']) &&$_POST['submit']=="yes") {
echo "thank you very much.";
} else {
?>
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='POST'>
<input type='text' name='email'>
<input type='text' name='first_name'>
<input type='submit' name='submit' value='yes'>
</form>
<?php
}
?>
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
.
- References:
- beginning PHP problem
- From: Drazen
- Re: beginning PHP problem
- From: Duderino82
- beginning PHP problem
- Prev by Date: Re: beginning PHP problem
- Next by Date: Re: beginning PHP problem
- Previous by thread: Re: beginning PHP problem
- Index(es):
Relevant Pages
|