1

i am trying to get complete php url.My url is

http://localhost/site/allproducts.php#oral

i can use $_SERVER['REQUEST_URI']; to get uri first part but #oral is not working

my question is how do i get this part of the url

Sikander
  • 2,799
  • 12
  • 48
  • 100
  • 5
    You can't. It's not getting sent to the server. – tereško May 16 '17 at 12:41
  • so is there any way out to do this ? – Sikander May 16 '17 at 12:42
  • http://stackoverflow.com/questions/940905/can-i-read-the-hash-portion-of-the-url-on-my-server-side-application-php-ruby – Ahmed Ginani May 16 '17 at 12:44
  • @Sikander it depends. You can use JS to transform that URL, but it wont work with direct links. Instead I would recommend using "pushstate" (so that your link actually says `http://localhost/site/allproducts/oral`. Also, I suspect a big part of the problem is that you don't know how to do routing in PHP. Maybe [this](http://stackoverflow.com/a/19309893/727208) is helpful for you. – tereško May 16 '17 at 12:46

0 Answers0