$currentFile = $_SERVER["PHP_SELF"]; $parts = Explode('/', $currentFile); $curpage = $parts[count($parts) - 1]; ?>