Get Full URL of user / visiter system in PHP?
Friday, March 5, 2010 12:19Posted in category PHP Interview Questions
No Comments
<?php
echo getAddress();
function getAddress(){
### check HTTPS
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
### Get Full URL
return $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
?>
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.


