Re: POST and GET variables don't work
| From: | Jennifer Swofford | Date: | Sat, 12 Oct 2002 23:55:21 +0000 |
| Subject: | Re: POST and GET variables don't work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119753@lists.php.net to get a copy of this message | ||
Try:
$_Post[name];
or $HTTP_POST_VARS[name];
In new PHP version, register_globals is set to "off" by default, which is
why $name isn't working for you. Although, I'm surprised GET isn't
working....
Jen
> I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
>
> configure --with-java --with-apxs=/usr/local/apache/bin/apx
>
> It's running with Apache 1.3.26
>
> PHP work ok, even Java works, but if I try to pass variables from a form
> with either POST or GET, the variables don't get through. This is the
code
> I'm using:
>
> index.html:
> ...
> <form action="php.php" method="post">
> Name: <input type="text" name="name"><br>
> <input type="submit">
> </form>
> ...
>
> php.php:
>
> <?php
> echo "*";
> echo $name;
> echo "*";
> ?>
>
> The variable $name is always empty. I tried this same scripts on the RPM
> version installed with Mandrake 7.2 and it worked fine, so it shouldn't be
> the scripts. What could be wrong? Maybe I missed a ./configure option?
>
> Thanks in advance,
>
>
> Andres