Daily Archives: 15/06/2012

Php Code to Get Current Webpage URL

June 15, 2012   php   Author: 
PHP having the super global variables $_SERVER to get currently using page URL URL - http://www.tobbynews.com/page/2.php $_SERVER['PHP_SELF'] PHP_SELF will return the currently working webpage with their directory path ( /page/2.php ) $_SERVER['SCRIPT_NAME'] SCRIPT_NAME is introduced in CGI, and it also returns the currently working webpage ( /page/2.php ) $_SERVER['HTTP_HOST'] HTTP_HOST is a client controlled value and returns domain name (http://www.tobbynews.com) $_SERVER['SERVER_NAME'] SERVER_NAME is server controlled value (http://www.tobbynews.com) $_SERVER['REQUES