Format URL to go to the same directory
Posted by kurt_penang on July 16th, 2008 under Scripts
This allows you to format the URL to go to the directory where the file is placed. Very useful if you are wanting to write server independent PHP Apps.
$location = 'http://'.$_SERVER['SERVER_NAME'].implode("/", explode("/", $_SERVER['PHP_SELF'], -1)).'/';
![Subscribe to [ kurt-network ]](http://kurt-network.net/wp-content/themes/TimelessPerceptions/images/rss.jpg)
Leave a Reply