Usually you would pass URL parameters via GET, perhaps handled by your app index file, e.g.
You might then use a switch statement [php.net] to decide what to do based on the 'type'.
However, if you simply want to grab the 'name' of a PHP file, I would use regex:
<?php # get the filename = REQUEST_URI is also an option, but maybe less secure? $filename=$_SERVER['SCRIPT_FILENAME']; # match the part before .php preg_match('#.*/([^\.]+).php$#',$filename,$matches); $filename_part=$matches; # test output echo "<h1>$filename_part</h1>"; ?>