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.... Link to comment https://forums.phpfreaks.com/topic/158515-solved-true-filename-query/ 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... Link to comment https://forums.phpfreaks.com/topic/158515-solved-true-filename-query/#findComment-836022 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... Link to comment https://forums.phpfreaks.com/topic/158515-solved-true-filename-query/#findComment-836026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.