parameter and anchor tag

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
nay369
Forum Newbie
Posts: 2
Joined: Wed Jan 21, 2009 12:36 am

parameter and anchor tag

Post by nay369 »

the url is like this: http://www.domain.com/page/pagename:#1 book

actually, pagename is a parameter and "#1 book" doesn't go into the $pagename. Is there a way?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: parameter and anchor tag

Post by requinix »

No, there isn't. Not directly.

It can be done with JavaScript but that's not something you should consider trying.
nay369
Forum Newbie
Posts: 2
Joined: Wed Jan 21, 2009 12:36 am

Re: parameter and anchor tag

Post by nay369 »

hmm!
so there's no way?

yes, i found that it can be done with JS and i dont wanna use JS to read that param.

change the value before posting to url?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: parameter and anchor tag

Post by requinix »

nay369 wrote:hmm!
so there's no way?
When the browser asks your server for the page it doesn't tell it what the anchor/hash is. The browser literally asks for "/page/pagename:". When it gets the page back it looks for the "1 book" anchor and (if found) scrolls to it.

Since PHP works on the server, and the server doesn't know about the anchor, PHP won't know about it either.
Post Reply