Get Full Url Path excluding PHP Script's name
PHP_SELF wont give you script path alone, it gives full path inclusive file.name. And "dirname(__FILE__)" gives you system path, nothing for web.
$full_url_path = "http://" . $_SERVER['HTTP_HOST'] . preg_replace("#/[^/]*\.php$#simU", "/", $_SERVER["PHP_SELF"]);
Similar entries
- need help for customizing PHP-grep files search
- Search in text files recursively with PHP - Grep
- How to setup auto_prepend_file with safe mode and open basedir restriction
- Howto install Volatility (RAM / Memory Forensic Framework) in Windows
- Url manipulation with mod_rewrite and php-catcher for beginners
- Redirect webpages with HTML, PHP, .htaccess, Java+Script, CGI-Perl, ASP.NET and ColdFusion
- .htaccess examples
- Howto protect admin.php / login.php with htaccess password
- Add to Facebook Block for Drupal
- How to mount shared Folder in VirtualBox and Ubuntu Linux
- Filezilla and plain-text clear, unsecure password storage
- How to recursively create md5 and sha1 sum of your files.
- Get top 100 words / keywords from a text with PHP
- Import big SQL Files under WAMP or LAMP ?
- What is my IP Address and HostName?
- Set auto_prepend_file with .htaccess on Hosteurope managed hosting
- Smart Multi-Uploader and Thumbnail Creator from GIF/ JPEG/ PNG with PHP
- Page generation time and http-referers with PHP
- Upload multiple images with PHP
- Next generation URLs, hostname/id without www and long-keywords

Post new comment