Skip to content

Instantly share code, notes, and snippets.

@verteb
Created March 20, 2012 02:02
Show Gist options
  • Select an option

  • Save verteb/2130011 to your computer and use it in GitHub Desktop.

Select an option

Save verteb/2130011 to your computer and use it in GitHub Desktop.
PHP: get_current_page_url()
/**
* Retourne l'url de la page courante
* @return string
*/
function get_current_page_url(){
return (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment