Page 1 of 1

abc.php?page=anotherpage# -- question

Posted: Tue Apr 06, 2010 11:28 pm
by supernova122
Hi,

I don't understand the syntax of the following URL. Can anyone please help to advise me what it does? Thanks.

http://abc.php?page=anotherpage#

Re: abc.php?page=anotherpage# -- question

Posted: Tue Apr 06, 2010 11:31 pm
by requinix
That's not a valid URL (but it is a URI).

In general, this.

Re: abc.php?page=anotherpage# -- question

Posted: Wed Apr 07, 2010 8:52 pm
by supernova122
Sorry. I don't understand. Can you please tell me what it does in general? Thanks a lot.

Re: abc.php?page=anotherpage# -- question

Posted: Wed Apr 07, 2010 9:41 pm
by requinix
In general,

Code: Select all

<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]
(Stuff in the []s are optional.)
The scheme is the scheme. Like a protocol. Basically just some short identifier that says what kind of stuff comes next and how it should be treated.
The hierarchical part is a hierarchy. Could be anything, really.
The query allows for some sort of question. Format varies.
The fragment can be used to locate some part in the result, like a page number or bookmark.

In general, for HTTP, the scheme is "http"; the hierarchical part is two slashes, a domain, another slash, and possibly a bunch more stuff (often itself a hierarchy delimited with slashes); the query is a list of key=value pairs separated by ampersands; and the fragment is used for anchor links.

What you gave is invalid for HTTP, but works as a URI because

Code: Select all

http://abc.php?page=anotherpage#
the scheme is "http", the hierarchical part is "//abc.php", the query is "page=anotherpage", and the fragment is empty.