Re: How to get the query string?

From: Date: Tue, 14 Aug 2001 06:00:29 +0000
Subject: Re: How to get the query string?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62573@lists.php.net to get a copy of this message
You wrote: > hi guys, > > I'd like to get the query string the browser sends to the script. The > problem is that since the $HTTP_POST_VARS (or $HTTP_GET_VARS ) is an > associative array I can't use numbers to point to the elements of > this array. This piece of code does not work: > > for ($a=1;$a<=sizeof($HTTP_POST_VARS);$a++){ > echo "$a. ".$HTTP_POST_VARS[$a]."<br>"; > } Use: print_r($HTTP_POST_VARS); -or- foreach($HTTP_POST_VARS as $k => $v){ echo "$k => $v<br>\n"; } -or- while(list($k, $v) = each($HTTP_POST_VARS)){ echo "$k => $v<br>\n"; } -- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/

« previous php.general (#62573) next »