For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > June 2007 > The pound # in $_SERVER variables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author The pound # in $_SERVER variables
Jim Carlock

2007-06-30, 10:04 pm

(1) test.php?test_key=test_value

$_SERVER['SCRIPT_NAME'] returns /test/test.php
$_SERVER['REQUEST_URI'] returns /test/test.php?test_key=test+value
$_SERVER['QUERY_STRING'] returns test_key=test+value

(2) test.php? test_key=test_value#test_internal_sublin
k

$_SERVER['SCRIPT_NAME'] returns /test/test.php
$_SERVER['REQUEST_URI'] returns /test/test.php?test_key=test+value
$_SERVER['QUERY_STRING'] returns test_key=test+value

Questions
(1) What do you call a sublink with the pound (#) symbol?
(2) How do I get to the #test_internal_sublink?

--
Jim Carlock


Iván Sánchez Ortega

2007-06-30, 10:04 pm

Jim Carlock wrote:

> (1) What do you call a sublink with the pound (#) symbol?


A link with a fragment identifier.

http://www.w3.org/TR/html401/intro/...ml#fragment-uri
http://www.w3.org/TR/html401/struct/links.html#h-12.1.1

> (2) How do I get to the #test_internal_sublink?


You don't. Webservers do not care about fragment URIs, and only buggy
browsers send that info th them.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

TAG! TAG! -¿Quién es?
Jim Carlock

2007-06-30, 10:04 pm

Jim Carlock wrote:
> (1) What do you call a sublink with the pound (#) symbol?



"Iván Sánchez Ortega" replied:
: A link with a fragment identifier.
:
: http://www.w3.org/TR/html401/intro/...ml#fragment-uri
: http://www.w3.org/TR/html401/struct/links.html#h-12.1.1

Thanks Iván. "Anchor" was the word. Will keep "fragment-uri"
in mind too and really need to process it through javascript. Just
wondered if there was a way to process server-side as well as I
noticed it didn't show up in the $_SERVER variables.

--
Jim Carlock


Allodoxaphobia

2007-06-30, 10:04 pm

On Sat, 30 Jun 2007 19:08:25 +0200, Iván Sánchez Ortega wrote:
> Jim Carlock wrote:
>
>
> A link with a fragment identifier.
>
> http://www.w3.org/TR/html401/intro/...ml#fragment-uri


I suppose - for the Subject: - _that_ would be a self-referential answer!
:-)

Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>
denisb

2007-06-30, 10:04 pm

Jim Carlock <anonymous@127.0.0.1> wrote:
> (1) test.php?test_key=test+value
> $_SERVER['SCRIPT_NAME'] returns /test/test.php
> $_SERVER['REQUEST_URI'] returns /test/test.php?test_key=test+value
> $_SERVER['QUERY_STRING'] returns test_key=test+value
>
> (2) test.php? test_key=test+value#test_internal_sublin
k
> $_SERVER['SCRIPT_NAME'] returns /test/test.php
> $_SERVER['REQUEST_URI'] returns /test/test.php?test_key=test+value
> $_SERVER['QUERY_STRING'] returns test_key=test+value
>
> Questions
> (2) How do I get to the #test_internal_sublink?


maybe you can see around 'parse_url()' function :

<http://www.php.net/manual/en/function.parse-url.php>

--
@@@@@
E -00 comme on est very beaux dis !
' `) /
|\_ =="
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com