shamuraq Posted May 17, 2009 Share Posted May 17, 2009 Hi Guys... [scenario]: I tied my filenames to my index.php using this script: <?php $id=$_GET['id']; $f=$_GET['f']; if (is_null($id)==true) { $fname="s_index.php"; } else { $fname="s_".$id.".php"; } if (is_null($f)==true) { $king="KO"; } else { $fname=$f."/".$fname; } ?> so that the accessed page(eg. s_01.php) will end up as index.php?id=01 [Question] How do i query the actual filename(eg. s_01.php) and the true path? I tried using: <?php $currentFile = $_SERVER["PHP_SELF"]; $parts = Explode('/', $currentFile); echo $parts[count($parts) - 1]; ?> but it keeps giving "index.php" instead of the actual filename(eg. s_01.php).... Any suggestion? Thanx in advance guys.... Quote Link to comment Share on other sites More sharing options...
shamuraq Posted May 17, 2009 Author Share Posted May 17, 2009 Sorry guys.... i figured it out already... Quote Link to comment Share on other sites More sharing options...
papaface Posted May 17, 2009 Share Posted May 17, 2009 It would have been helpful for you to post the answer for anyone interested... Quote Link to comment 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.