PHP get current page

March 10, 2008

<?php
$currentFile = $_SERVER["PHP_SELF"];
$parts = Explode(‘/’, $currentFile);
echo $parts[count($parts) - 1];
?>

same as with

<?php
basename($_SERVER[’PHP_SELF’]);
?>

Leave a Reply