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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/124132-solved-easy-speed-question/#findComment-640897 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.