Jump to content

get url?


MDanz

Recommended Posts

It's always a good idea to Google (or whatever search engine you prefer) what you're looking for before you post a topic. A simple search returns this page: http://www.webcheatsheet.com/PHP/get_current_page_url.php.

function 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;
}

Link to comment
https://forums.phpfreaks.com/topic/178999-get-url/#findComment-944380
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.