• 10th, Jun 2010

PHP Get Requested Page

$identifier=$_SERVER['REQUEST_URI'];
$page=substr($identifier, strrpos($identifier,'/') + 1, strlen($identifier));
//full url
"http://".$_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
//Note: It should implement port if the is a https page

Tags: , ,

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.