A simple function that I had used in the Translation Plugin, this could be your use. This is a PHP function which can get you the URL of the page being visited.
function kish_trans_curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
You can print the URL by using this function
Related posts:
Kishore Asokan is the author of this blog and has been blogging since 1999.
He is a software professional from Carnegie Technology of Education, Pittsburgh, USA. He works on
.NET, PHP, AJAX, etc. He has been making money online for the past 10 years and is still learning
to monetize his skills. He has recently launched his 
[...] How to get the current URL of web page in PHP (Note: I’ve changed the name of the function from kish_trans_curPageURL to pageURL to keep [...]