Re: [PHP] catching URL#target params
Hi, it could be done only by parsing $_SERVER['QUERY_STRING'] variable ... eg $querystring = $_SERVER['QUERY_STRING']; eregi(#([a-z0-9_.-]*), $querystring, $arg); $hashtarget = $arg[1]; /tom On Mon, 15 Mar 2004 08:52:43 -0500 David T-G [EMAIL PROTECTED] wrote: Hi, all -- I know that I can easily see http://URL?param=value and even http://URL?value but I haven't found any way to capture http://URL#target as one would use to jump to a certain location in a plain HTML file. When I try this in a PHP file and run phpinfo, I see nothing that includes that target. Is there a var that will work for me? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
but I haven't found any way to capture http://URL#target as one would use to jump to a certain location in a plain HTML file. When I try this in a PHP file and run phpinfo, I see nothing that includes that target. Is there a var that will work for me? usually this part of the URL is handled by the browser and I have not find a way to get at this with PHP. maybe via a javascript detour? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
Tom, et al -- ...and then Tom Meinlschmidt said... % % Hi, Hi! % % it could be done only by parsing $_SERVER['QUERY_STRING'] variable ... Well, that's what I thought of first, but I got nothing. To wit: bash-2.05a$ lynx -dump wftst.web-folio.net/help.php#foo | egrep -i 'foo|query' QUERY_STRING no value QUERY_STRING no value _SERVER[QUERY_STRING] no value _ENV[QUERY_STRING] no value Any other ideas? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] catching URL#target params
BACK BACK BACK. I'm a stupid fool ... #something is NOT send to the server, so it's unable to track it ... sorry /tom request was a.php?aasdf=1234a#greetz and from apache log someip - - [15/Mar/2004:15:01:37 +0100] GET /~znouza/a.php?aasdf=1234a HTTP/1.1 200 3325 On Mon, 15 Mar 2004 15:00:04 +0100 Tom Meinlschmidt [EMAIL PROTECTED] wrote: Hi, it could be done only by parsing $_SERVER['QUERY_STRING'] variable ... eg $querystring = $_SERVER['QUERY_STRING']; eregi(#([a-z0-9_.-]*), $querystring, $arg); $hashtarget = $arg[1]; /tom On Mon, 15 Mar 2004 08:52:43 -0500 David T-G [EMAIL PROTECTED] wrote: Hi, all -- I know that I can easily see http://URL?param=value and even http://URL?value but I haven't found any way to capture http://URL#target as one would use to jump to a certain location in a plain HTML file. When I try this in a PHP file and run phpinfo, I see nothing that includes that target. Is there a var that will work for me? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
At 15:00 15-3-04, Tom wrote: it could be done only by parsing $_SERVER['QUERY_STRING'] variable ... nay, the hash value is not there -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
Chris, et al -- ...and then Chris Hayes said... % % but I haven't found any way to capture % % http://URL#target ... % Is there a var that will work for me? % % usually this part of the URL is handled by the browser and I have not find % a way to get at this with PHP. Ahhh... Bummer! % maybe via a javascript detour? Can't do that since I'm trying to write code that can handle the old style call from some page that hasn't been updated, which means that I don't control it. All of my pages that point to help, of course, will have been fixed already :-/ Thanks HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] catching URL#target params
Tom, et al -- ...and then Tom Meinlschmidt said... % % BACK BACK BACK. I'm a stupid fool ... No you aren't, or that means I'm one for thinking the same thing. Hmmm... That doesnt' lend a lot of weight to your side :-) % % #something is NOT send to the server, so it's unable to track it ... Really? You mean it stays with the browser entirely? Wow. % % sorry Yeah; thanks anyway! % % /tom % % request was a.php?aasdf=1234a#greetz % and from apache log % someip - - [15/Mar/2004:15:01:37 +0100] GET /~znouza/a.php?aasdf=1234a HTTP/1.1 200 3325 Hully gee; it sure looks like you're right. Well, anyone with old calls will just be screwed, then. On with work... Thanks again HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] catching URL#target params
is possible to catch it by javascript, but I have no clue how to use with normal hrefs (not forms) try script alert(document.location); /script and you'll get entrire request with #target part too. /tom -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] catching URL#target params
David, The only thing I can think of is using Javascript to set a cookie with the variable from window.location.href and then using PHP to pick up the value. Rather crude but it might work. Will -Original Message- From: David T-G [mailto:[EMAIL PROTECTED] Sent: 15 March 2004 14:08 To: PHP General list Cc: Tom Meinlschmidt Subject: Re: [PHP] catching URL#target params Tom, et al -- ...and then Tom Meinlschmidt said... % % BACK BACK BACK. I'm a stupid fool ... No you aren't, or that means I'm one for thinking the same thing. Hmmm... That doesnt' lend a lot of weight to your side :-) % % #something is NOT send to the server, so it's unable to track it ... Really? You mean it stays with the browser entirely? Wow. % % sorry Yeah; thanks anyway! % % /tom % % request was a.php?aasdf=1234a#greetz % and from apache log % someip - - [15/Mar/2004:15:01:37 +0100] GET /~znouza/a.php?aasdf=1234a HTTP/1.1 200 3325 Hully gee; it sure looks like you're right. Well, anyone with old calls will just be screwed, then. On with work... Thanks again HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
I think that the only way to catch it is to rewrite the URL. 1)Write pages with appropriates links. Somethink like href='www.yoursite.com/anchor_target/index.php' 2)Create e rewrite rule in the htacces file. 3)Catch the target value from the php page parsing the rewritten URL www.yoursite.com/index.phpanchor=target I did it and it works. Sebastiano -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] catching URL#target params
Sebastiano, et al -- ...and then Seba said... % % I think that the only way to catch it is to rewrite the URL. % % 1)Write pages with appropriates links. Somethink like % href='www.yoursite.com/anchor_target/index.php' Hmmm... Do you mean that I should write the calling page this way? I can't do that; I'm planning for pages that I don't own that may not be updated (or even formed properly from the start). Or do you mean I create a subdir and index.php file for every possible link target? Ugh; there are way too many of those. Given a URL like http://web-folio.net/help.php#delcoll that should look like http://web-folio.net/help.php?req=delcoll for the new script, what do I put where in my site dir? % % 2)Create e rewrite rule in the htacces file. OK. % % % 3)Catch the target value from the php page parsing the rewritten URL % www.yoursite.com/index.phpanchor=target That sounds good, I think. % % I did it and it works. Great! Now tell me more :-) % % % Sebastiano Thanks HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] catching URL#target params
Chris, et al -- ...and then David T-G said... % % ...and then Chris Hayes said... % % ... % % maybe via a javascript detour? % % Can't do that since I'm trying to write code that can handle the old % style call from some page that hasn't been updated, which means that I % don't control it. All of my pages that point to help, of course, will % have been fixed already :-/ After thinking about this I suddenly realized that such a JS detour would fit well in my main help script, since that is what would catch the http://URL#target link whether it can display it or not. So in my script, when no param is specified, I would need some code to see what the #target is and, if present, reload with the proper ?req=target link. That might work well. So now, if I could stand the JS in my script, can anyone write me some code I can have? :-) Thanks again HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] catching URL#target params
Il lun, 2004-03-15 alle 15:55, David T-G ha scritto: Sebastiano, et al -- ...and then Seba said... % % I think that the only way to catch it is to rewrite the URL. % % 1)Write pages with appropriates links. Somethink like % href='www.yoursite.com/anchor_target/index.php' Hmmm... Do you mean that I should write the calling page this way? I can't do that; I'm planning for pages that I don't own that may not be updated (or even formed properly from the start). Or do you mean I create a subdir and index.php file for every possible link target? Ugh; there are way too many of those. Given a URL like http://web-folio.net/help.php#delcoll that should look like http://web-folio.net/help.php?req=delcoll for the new script, what do I put where in my site dir? The first one. But if you do not own the pages I have not any idea to solve the problem. % % 2)Create e rewrite rule in the htacces file. OK. % % % 3)Catch the target value from the php page parsing the rewritten URL % www.yoursite.com/index.phpanchor=target That sounds good, I think. % % I did it and it works. Great! Now tell me more :-) % % % Sebastiano Thanks HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php