Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?

前端 未结 12 2550
无人及你
无人及你 2020-11-21 04:37

Assuming a URL of:

www.example.com/?val=1#part2

PHP can read the request variables val1 using the GET array.

Is the ha

12条回答
  •  青春惊慌失措
    2020-11-21 05:08

    Yes you can:

    Use this method to prevent errors:

    
    

    And of course in PHP, explode that puppy and get one of the values

    $split = explode('/', $_COOKIE['anchor']);
    print_r($split[1]); //to test it, use print_r. this line will print the value after the anchortag
    

提交回复
热议问题