URL_Current() = Gets the current URL (IIS Safe)

PHP Code

	public function URL_Current() {
		/*
		Purpose
			Used to get the complete URL of the current page.
		Return (String)
			Returns the URL of the current requesting page.
		Version History
			1.0 6/26/2008 by Russ Tanner
		*/

		// Initialize the return buffer with the protocol. The expression is built to accomodate IIS.
		$r = (! is_null($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http';

		$r .=  '://' . $_SERVER['HTTP_HOST']; // Append the protocol delimiter and hostname
		
		// This is not port 80, append the port number
		if ($_SERVER['SERVER_PORT'] != '80') $r .=  $_SERVER['SERVER_PORT'] . ':';

		// Append the URI
		$r .= $_SERVER['REQUEST_URI'];
		
		return $r;
	} 


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)