Re: How to get the query string?
| From: | Renze Munnik | Date: | Mon, 13 Aug 2001 13:43:25 +0000 |
| Subject: | Re: How to get the query string? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62423@lists.php.net to get a copy of this message | ||
On Mon, Aug 13, 2001 at 03:06:48PM +0200, Tamas Bucsu 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>";
> }
>
> Please help
>
> Tamas Bucsu
For the complete query-string: $HTTP_SERVER_VARS{"QUERY_STRING"}
Eg.: http://www.some-domain.com/index.php?one=xxx&two=yyy
$HTTP_SERVER_VARS{"QUERY_STRING"}: "one=xxx&two=yyy";
But you can also use:
$HTTP_GET_VARS{"one"} and $HTTP_GET_VARS{"two"}, etc:
$HTTP_GET_VARS{"one"}: "xxx";
$HTTP_GET_VARS{"two"}: "yyy";
Or you can use:
$one and $two, etc.
$one: "xxx"
$two: "yyy"
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: renze@datalink.nl
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM HAARLEM
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««