Re: Passing through Array's to another script

From: Date: Tue, 18 Dec 2001 14:58:10 +0000
Subject: Re: Passing through Array's to another script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-78066@lists.php.net to get a copy of this message
> However, you can't do this: > <form action="script.php?a=foo&b=bar" method="post"> > <input name="c"> > </form> > Because a & b won't get submitted. Well, like I said, I don't understand very well, but things after the ? are available on the action page, even if the method is POST. Here's a tested example (PHP 4.1.0, Win2k AS, Apache 1.13.20) aaa.php: <form method="post" action="bbb.php?var=value"> <input type="submit"> </form> bbb.php <?php echo $HTTP_GET_VARS['var'].'<br>'; echo $_GET['var'].'<br>'; echo $REQUEST_METHOD; ?> Shows: value value POST So, the method is still POST, but things after ? are also available. What should not work is this: aaa.php: <form method="post" action="bbb.php"> <input name="var"> <input type="submit"> </form> bbb.php: echo $_GET['var']; But for this one I didn't test... -- Julio Nobrega.

« previous php.general (#78066) next »