-1

I've searched around on this matter but to no avail. I am having an URL like this: http://www.mydomain.test/en/cat/tiagua/#Comment10

It should lead the user to the page "tiagua" and directly jump to comment number 10 (which is the ID of the comment).

As far as my site is concerned the number of comments per page is reduced to 5. Because comments can have one or many answers (like on this page) calculating the page that requires to be loaded from the outside (where the link is created) would involve lots of trouble.

In order to display the correct commentspage with comment number 10 the page "tiagua" should know about this. But I haven't found out how to get the part after the sha-character [#]

hy-soft
  • 153
  • 2
  • 12
  • The answer to the question in the title is [here](http://stackoverflow.com/questions/3847870/php-to-get-value-of-hashtag-from-url). – Daniel Apr 26 '14 at 16:37
  • Thanks now I understand. If its a client side issue I will have to find another solution. – hy-soft Apr 26 '14 at 16:52

1 Answers1

0

What you're asking is impossible, because the part of the URL after the # character is never sent to the server. You have two options:

  • Read the hash portion of the URL with JavaScript and perform a request based on that information.
  • Use query variables, e.g. /tiagua?comment=10.
Overv
  • 7,985
  • 2
  • 32
  • 67
  • Hi @Overv Using query variables is one option I was thinking of before. But actually i would need it like that: /tiagua?comment=10#comment10 so the browser jumps to the anchor in question... Thanks anyway. Sorry I am too young to vote up... )-; – hy-soft Apr 26 '14 at 16:54