Vivid Lust Posted October 28, 2009 Share Posted October 28, 2009 I'm using the following code, but it isnt working - it doesnt echo "homepage" when it is on the root page, e.g : www.mysite.com/ :'( <?php $addressFull = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; if( $addressFull == $_SERVER["SERVER_NAME"] ){ echo 'homepage'; }?> Help anyone? Thanks Link to comment https://forums.phpfreaks.com/topic/179353-solved-check-if-current-page-is-homepage/ Share on other sites More sharing options...
seanlim Posted October 28, 2009 Share Posted October 28, 2009 try changing your conditional to: if( $_SERVER['REQUEST_URI']=="/"){ Link to comment https://forums.phpfreaks.com/topic/179353-solved-check-if-current-page-is-homepage/#findComment-946304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.