Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

[PHP] RE: Query String Name ? From: Miroslav Hudák (maniax <email protected>)
Date: 07/26/01

  
  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 <email protected>:maniax <email protected>]-----------------------[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 <email protected>]
> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>