logo Lee Johnson SEO

Get URL of Current Page (PHP)

<?
// gets the url of the page
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
?>

Add the following where you want the URL of the page to be placed.

<? echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>