With regard to PHP, how does one get query and posted variables?

With regard to PHP, how does one get query and posted variables?

Post by Rasmus Lerdo » Wed, 02 Sep 1998 04:00:00




says...

Quote:> Read the PHP documentation.  There is only one thing that does not make
> complete sense to me.  How does one get the posted and queried variables?

> Example:
> page1.html has a form as follows
> <form action="GetMe.php3" method="post">
> <input type=text name="Querybox">
> </form>

> How, on my GetMe page, do I retrieve the value for Querybox?

echo $Querybox;

I think you are thinking too much.  All GET, POST, Cookie and environment
variables are available automatically in the PHP symbol table.  You don't
have to do anything.

-Rasmus

 
 
 

With regard to PHP, how does one get query and posted variables?

Post by Dougal Campbel » Wed, 02 Sep 1998 04:00:00



> Read the PHP documentation.  There is only one thing that does not make
> complete sense to me.  How does one get the posted and queried variables?

The docs *do* need a little work. They mention in a couple of places
that GET/POST variables become regular PHP variables, but they don't
make it *really* clear. But there are some good examples available (see
the Links section from the main PHP webpage).

Quote:> Example:
> page1.html has a form as follows
> <form action="GetMe.php3" method="post">
> <input type=text name="Querybox">
> </form>

> How, on my GetMe page, do I retrieve the value for Querybox?

Two different ways you can do it:
  <?php echo $Querybox; ?>
  <?php echo $HTTP_POST_VARS{"Querybox"}; ?>

In any case, as you can see, GET and POST variables for form elements
with <name=something> become regular PHP vars called $something.

--

http://www.advicom.net/                 http://advicom.net/~dougal/
           See my homepage for anti-spam information!
       Public PGP key available at http://pgp5.ai.mit.edu/
          or http://advicom.net/~dougal/dougal-pgp.txt
QUOTE OF THE MOMENT:
Pushing 40 is exercise enough.

 
 
 

1. one more query regarding execl

hi all,
I have one more query to ask.
I have a program which starts one thread which in turn launches
another thread.
In the last thread if I do a fork & then execl it  crashes the
application.
No core is generated & neither there is a signal thrown.
I really don't know the consequences of fork from a thread, relatively
new to linux development.
Please tell me if I have to provide more info.

Thanks in advance.

Regards,
Niraj.

2. trapping ctrl-alt-del

3. Repost: Problems with Apache and PHP - first post went awry

4. jove on the rs/6000

5. Solaris - PHP- Apache- Oracle : Problem getting PHP installed

6. Solaris 2.6 Release Date?

7. Other post-setenv/post-query

8. Executing a POST action behind a firewall

9. Reading HTTP POST Variables in Shell Variables - HOW?

10. creation of a variable from another variable (another posting)

11. Two questions: One regarding kernel messages with IP Masquerade and one on Redhat 4.0 startup

12. One to One NAT query

13. Apache w/ PHP and SSL: w/ PHP OK - w/out PHP NOK