Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to catch #

Status
Not open for further replies.

elck

Programmer
Apr 19, 2004
176
NL
Interesting problem?
$_SERVER['QUERY_STRING'] returns all variables, but never the # position in the file, as in:




I cannot find a global variable that does return it either.
Any suggestions?
 
The parse_url function would probably be kind of handy for this:
Code:
//grab the URI
$url = $_SERVER['SCRIPT_URI'];
//parse it
$parsed = parse_url($url);
//parse_url returns an associative array, with the portion after the hashmark stored as 'fragment'
$target_section = $parsed['fragment'];

There might be a better way, I'm not an expert by any means.
-T

 
Parsing the URI is not the problem,
but grabbing it is.
I cannot find a way to get the url string containing the # part.

 
It seems reasonable to me that the browser would not send that to the server. That information is of use only to the browser.

Looking at my server logs, I see that none of Opera 9, IE 6 or FireFox actually transmits the data to the server.



Want the best answers? Ask the best questions! TANSTAAFL!
 
That explains it.
It's a pitty as I wanted to use the info for unfolding the proper submenus.

Thanks Sleipnir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top