A useful function to get and display the current page url.
<?php
function getPageURL() {
$pURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pURL;
}
echo getPageURL();
?>





thanks for the script. This is very useful especially for wordpress if you want to add functions or html to a specific page only