Get Page Name from Web Address using PHP

Error message

Deprecated function: Function create_function() is deprecated in GeSHi->_optimize_regexp_list_tokens_to_string() (line 4698 of /home/digipiph/public_html/sites/all/libraries/geshi/geshi.php).

With PHP you can recognize the page you are on and then display a proper header for that page.

For example:

<?php
// let's say the URL is page.com/form.php
$page_name =  basename($_SERVER['PHP_SELF'],".php");
print $page_name; //form
?>

Tags: