Eggzorcist Posted September 14, 2008 Share Posted September 14, 2008 If I have the following in a header.php in a root of localhost. $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']; and my header is attached to a file in /localhost/hello/index.php will the phpself think its the root of localhost or in hello/index.php? thanks Link to comment https://forums.phpfreaks.com/topic/124132-solved-easy-speed-question/ Share on other sites More sharing options...
genericnumber1 Posted September 14, 2008 Share Posted September 14, 2008 $_SERVER['PHP_SELF'] displays the current main file... so if index.php includes otherfile.php... the line $_SERVER['PHP_SELF'] on otherfile.php will still return index.php. Use the __FILE__ constant if you want it to return otherfile.php. Link to comment https://forums.phpfreaks.com/topic/124132-solved-easy-speed-question/#findComment-640897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.