If you have mydomain.com/category/page.php
$_SERVER['SCRIPT_FILENAME'] gives you category/page.php
But is there something that gives you just page.php
If not how do you edit category/page.php or whatever it may be, e.g. category1/category2/page.php so it becomes only page.php?