0

I am trying to create a toolbar on the bottom of my page using php. It should be dynamic and it should not include links for the page it is embedded in. When i use the following code.

$path = $_SERVER['SCRIPT_NAME'];

It grabs the url of the page toolbar.php. I am attempting to grab the page the toolbar PHP is embedded in. Any Ideas?

1 Answers1

0

Use $_SERVER['REQUEST_URI']

$full_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

Or...

$page = basename($_SERVER['PHP_SELF']);
Kylie
  • 11,421
  • 11
  • 47
  • 78