Re: [PHP] Re: Address unknown

2002-02-02 Thread CC Zona

In article <001001c1ac45$406eab00$017f@localhost>,
 [EMAIL PROTECTED] (Hugh Danaher) wrote:

> Thank you for your help regarding parsing the url (Hey, go figure, they
> named the function almost exactly the same as my question.).
> 
> I am still at sea about getting all the information from the url header.  If
> I leave the brackets empty [e.g. parse_url() ] I get an error saying I have
> a parameter mismatch.  When I fill the brackets with $query_string, I get an
> answer but it's in the form of an array.  Finally when I echo the array, the
> "query" string echos in the "path" slot.  Any ideas?
> Hugh
> 
> $p=parse_url($QUERY_STRING);
> echo $p[host]." 1 ".$p[path]." 2 ".$p[query]." 3 ";

If you feed parse_url() something other than a URL (a query string being a 
URL *fragment* rather than a URL itself), it's not surprising that it will 
return weird results.

When you echo $QUERY_STRING, what value are you getting?  For...

> > file:///C:/php/museum/DB MUSE/someplace.php?98,165

I'd expect it to be "98,165".  IOW, pre-parsed, no need to parse_url().

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Address unknown

2002-02-02 Thread hugh danaher

Thank you for your help regarding parsing the url (Hey, go figure, they
named the function almost exactly the same as my question.).

I am still at sea about getting all the information from the url header.  If
I leave the brackets empty [e.g. parse_url() ] I get an error saying I have
a parameter mismatch.  When I fill the brackets with $query_string, I get an
answer but it's in the form of an array.  Finally when I echo the array, the
"query" string echos in the "path" slot.  Any ideas?
Hugh

$p=parse_url($QUERY_STRING);
echo $p[host]." 1 ".$p[path]." 2 ".$p[query]." 3 ";
- Original Message -
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 02, 2002 1:58 PM
Subject: [PHP] Re: Address unknown


> In article <000e01c1ac31$2cdf6f20$017f@localhost>,
>  [EMAIL PROTECTED] (Hugh Danaher) wrote:
>
> > Some one please tell me to RTFN!, but first tell me where to look. :-)
> >
> > I have a page with an image of a map which delivers the following info
to the
> > address bar of someplace.php.  the  html code
> > delivers the coordinates of the cursor when clicked.  What I want to do,
is
> > get the following so that I can parse it.
> >
> > file:///C:/php/museum/DB MUSE/someplace.php?98,165
>
> phpinfo()  will show you all the server variables
> at your disposal, including $QUERY_STRING.
>
> parse_url()  is also a useful one to know about.
>
> And explode()  will parse that comma-delimited
list
> of coordinates into an array so you can access the values individually.
>
> Cheers!
>
> --
> CC
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]