My php is quite rusty, i need quick fix for how tho show text only if you are on the homepage (index.php) Here is what i've come up so far, the problem is that it ALWAYS outputs the text, not only for the homepage function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } if (curPageName() == 'index.php') {echo 'kef';} Code (markup): there should be something small i got wrong?
<?php $cp = $_SERVER['REQUEST_URI']; if($cp=="/" || $cp=="/index.php" || $cp=="" ) { echo "hello" } ?> I hope it helps Regards Alex