abc.php?page=anotherpage# -- question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
supernova122
Forum Newbie
Posts: 4
Joined: Tue Apr 06, 2010 11:21 pm

abc.php?page=anotherpage# -- question

Post 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#
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post by requinix »

That's not a valid URL (but it is a URI).

In general, this.
supernova122
Forum Newbie
Posts: 4
Joined: Tue Apr 06, 2010 11:21 pm

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

Post by supernova122 »

Sorry. I don't understand. Can you please tell me what it does in general? Thanks a lot.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post 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.
Post Reply