0

I have a single page PHP app and use my urls as follows with a hashbang:

Now I'd like to display content only on my homepage and to do so I need to check if the URL contains a hashbang AND if it's empty, i.e.: If the user visited the homepage and if the user came back to the homepage after visiting another section (which applies the hashbang to it).

I've tried the following however it doesn't display the hashbang part, only if I set the url in the $curr_url variable.

$curr_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
   //only gets the url part before the /#!/
$url=parse_url($curr_url);
echo $url["fragment"];
DT.DTDG
  • 765
  • 1
  • 13
  • 31

0 Answers0