how do you check what file the current page if..
this is what i want to do..
if($current_page != "index.php"){ echo "click here to go to the index"; }
so i need to check what $current_page is does anyone know how to do this...
regards ryza
$PHP_SELF is the one.
dosnt work
PHP Version: 4.1.2
try $_SERVER['PHP_SELF']
that works but it actually prints the server path with the file name.. /dir/dir/filename
any idea how to just get filename.php ?
If nobody knows a better solution, this will work.
$start= $_SERVER['PHP_SELF']; $pat = "/"; $arr = split($pat, $start); $page= $arr[(count($arr)-1)];
http://www.phpbuilder.com/manual/function.basename.php
its not so simple guys. let me explain...
im trying to get the filename but im executing this code in a 'footer'
the real filename has.. include "footer.php";
so it thinks the file is (footer.php)
how can u get around this? 🙂
ok i worked it out..
🙂
thanks guys.