[plug] PHP - $_GET vars

James Devenish devenish at guild.uwa.edu.au
Tue Aug 31 14:59:22 WST 2004


Hi,

In message <OOECKHEBCBMDKGKDPJLHAEEIEPAA.jturner at bsis.com.au>
on Tue, Aug 31, 2004 at 02:21:40PM +0800, Jay Turner wrote:
> Can anyone tell me how I can print out all my $_GET parameters in one shot
> in PHP?
> ie q=1&b=2&c=3

There is a variety of built-in functions for displaying variables (e.g.
var_dump, print_r, or whatever -- the proper names elude me, but you do
have some options in PHP4 plus more options in PHP5). Alternatively, you
can build your own function to do this. If you specifically mean "how
can I convert my $_GET array back into a valid URL query string?", then
that is a different matter. Apache will probably make the original query
string available to you in a variable, but otherwise you will need to
reconstruct it according to the RFC rules for URLs. By the way, make a
new file containing <?php php_info(); ?> if you want to view all the
variables that your server feeds to your scripts. (PS. Maybe it's
phpinfo(); I can't remember.)





More information about the plug mailing list