Your Open Source

 
Related Links

PHP

get Current location/URL

The getURL() function used to get the CURRENT page location with query strings etc., the function as follows,


function getURL(){
$url = 'http://'.$_SERVER['HTTP_HOST'];
if($_SERVER['QUERY_STRING'] !='') $url .= $_SERVER['SCRIPT_NAME'] .'?'.$_SERVER['QUERY_STRING'];
else $url .= $_SERVER['REQUEST_URI'];
return $url;

}

  • hits 133
  • datetime Jul 04 09 04:59:09
  • author Sekar
  • rating

Rating : 12345

Comments

No Reply..

Quick Reply or Comments

Preview
Your Name:
Your Reply :
<> is a code tag
Enter the verification code: