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)? Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.