xProteuSx Posted January 10, 2012 Share Posted January 10, 2012 I have a file that is included on all pages of a website. However, I don't want it included on certain pages. What I was looking for was something like this: if ($current_page == 'index.html') {} else {require_once ...} How can I do this? Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/254700-code-according-to-page/ Share on other sites More sharing options...
xProteuSx Posted January 10, 2012 Author Share Posted January 10, 2012 Got if figured out: $current_page = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); Its pretty simple after that ... Quote Link to comment https://forums.phpfreaks.com/topic/254700-code-according-to-page/#findComment-1306015 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.