dooper3 Posted January 10, 2007 Share Posted January 10, 2007 Can i use PHP (or another method) to detect the name of the current page (i.e. if i am in the page advert.php, it will be able to tell)? Link to comment https://forums.phpfreaks.com/topic/33601-detecting-current-file-name/ Share on other sites More sharing options...
taith Posted January 10, 2007 Share Posted January 10, 2007 yup!full url:[code]<?function get_url(){ if(!empty($_SERVER[QUERY_STRING])) return 'http://'.$_SERVER[SERVER_NAME].$_SERVER[PHP_SELF].'?'.$_SERVER[QUERY_STRING]; else return 'http://'.$_SERVER[SERVER_NAME].$_SERVER[PHP_SELF];}echo get_url();?>[/code]just page:[code]<?echo $_SERVER['PHP_SELF'];?>[/code] Link to comment https://forums.phpfreaks.com/topic/33601-detecting-current-file-name/#findComment-157425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.