Re: Simple HTML-Form Question
| From: | Sascha Cunz | Date: | Sun, 13 Oct 2002 23:13:53 +0000 |
| Subject: | Re: Simple HTML-Form Question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119816@lists.php.net to get a copy of this message | ||
This beautifies it (even makes it a bit more secure), but one doesn't need it
really; should have worked without these changes, too. (Of course, it's
better to include these changes)
Sascha
> The value of name for the submit button is wrong - it should be the same
> as the value you gave the isset statement, in this case it should be
> <input type="submit" name="name" value="sendit">
> Better yet is to use isset($submit) and the value for the submit
> statement is also name="submit" -
> <input type="submit" name="submit" value="sendit">
> of course value is optional. So you end up with this -
>
> <?
> if (isset($_GET['submit']))
> {
> echo "Hallo ".$GET['name'];
> }
> else
> {
> echo "<FORM action='test.php' method=get>
> <input type='text' name='name'>
> <input type='submit' name='submit'
> value='sendit'>";
> }
> ?>