Current course:

Getting the current filename


$url = $_SERVER['PHP_SELF'];    // /interactive/code.php

$urlParts = explode("/", $url);    // same as: $urlParts = array("", "interactive", "code.php");

$file = $urlParts[count($urlParts)-1];     // code.php

$pg = substr($file,0,-4);     // code