RE: Query String Name ?
| From: | Miroslav Hudák | Date: | Thu, 26 Jul 2001 22:00:56 +0000 |
| Subject: | RE: Query String Name ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59839@lists.php.net to get a copy of this message | ||
Hi!
I think, that you could solve this problem by parsing the querystring
at own...
Try out this code:
<?php
//Parse the query string
$qs = $QUERY_STRING;
$parsed1 = Explode("&", $qs);
$c = 0;
foreach ($parsed1 as $p) {
List($vname, $vval) = Explode("=", $p);
$qs_args[$c]->name = $vname;
$qs_args[$c++]->value = $vval;
}
//This is only for demonstrational purposes, output is list
//of all variable names and values parsed from query string
foreach ($qs_args as $qa) echo $qa->name." =
".$qa->value."<BR>\n";
?>
Then, you'll have in $qs_args array structure, which contains the
variable names and values of all parsed query string vars.
Good luck,
m.:-/
+--[e-m@il:maniax@maniax.sk]-----------------------[whois:
MH18067-RIPE]-+
| "We are not retreating, we are advancing in another direction."
|
+--[Miroslav Hudak, http://maniax.host.sk]----------------------[-
mX
-]-+
> -----Original Message-----
> From: A [mailto:abe@fish.tm]
> Sent: Thursday, July 26, 2001 12:15 PM
> To: PHP General List
> Subject: Query String Name ?
>
>
> Hi there,
>
> is there any way to access two variables in a query string
> that have the same name e.g
>
> test.php?name=joe&name=bob
>
> Is there any way to extract both values of name without
> changing the way the query string is created?
>
>
> Thanks,
> Abe
>