Aaron
Aaron

Reputation: 4480

PHP get full url including the section of the page I want to jump to

I am trying to the full url in php, but am not able to get the section of the page I want to jump to. For example I am trying to get "http://192.168.10.10/#getstarted", but when I try to get the url I only get "http://192.168.10.10/".

Here is my code

 $url = sprintf(
            '%s://%s/%s',
            isset($_SERVER['HTTPS']) ? 'https' : 'http',
            $_SERVER['HTTP_HOST'],
            $_SERVER['REQUEST_URI']
        );
        echo($url);

Upvotes: 0

Views: 44

Answers (1)

ambrous
ambrous

Reputation: 194

You can't get the hash of the url from the server side. Hash is available only from the browser side.

Upvotes: 4

Related Questions