Re: Simple HTML-Form Question
| From: | Sascha Cunz | Date: | Sun, 13 Oct 2002 22:09:58 +0000 |
| Subject: | Re: Simple HTML-Form Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119813@lists.php.net to get a copy of this message | ||
register_globals defaults now to off. Use the superglobals instead.
<?
if (isset($_GET['name'])) {
echo "Hallo ".$GET['name'];
}
else {
echo "<FORM action='test.php' method=get>
<input type=text name=name>
<input type=submit name=action value=sendit>";
}
?>
Sascha
Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte:
> Hi,
> I've updated to PHP 4.2.3 and wrote this simple Script:
>
> <?
> if (isset($name)) {
> echo "Hallo $name";
> }
> else {
> echo "<FORM action='test.php' method=get>
> <input type=text name=name>
> <input type=submit name=action value=sendit>";
> }
> ?>
>
> I would expect the following:
> The site starts with the form, then I enter my name (Lars) and click the
> send-button. Then the script says Hello Lars.
>
> The actual output is:
> The site starts with the form, I enter my name and click the button, then
> the form keeps being there, no "Hello"-message.
>
> Has there changed something in PHP-Coding since I've learned it a few years
> before?
>
> There seems to be a diffrence between clicking the send button and pressing
> Enter. Has this always been so?
>
> regards
> Lars