note 18503 deleted from language.variables.predefined by nlopess
| From: | nlopess@php.net | Date: | Tue, 13 Jan 2004 14:52:30 +0000 |
| Subject: | note 18503 deleted from language.variables.predefined by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63434@lists.php.net to get a copy of this message | ||
Note Submitter: kmckay@aimentertainment.com
----
Here's a quick way to set a defined variable that returns your full server name including
protocol.
<?
// create the global _FULL_URL variable
if(isset($HTTP_SERVER_VARS[HTTPS]))
{ $_FULL_URL = 'https://'.$SERVER_NAME;}
else{ $_FULL_URL = 'http://'.$SERVER_NAME;}
// define the variable to make it accessable throughout your script
define('_FULL_URL',$_FULL_URL);
// echo the results
echo _FULL_URL;
// returns http://www.yourdomain.com
?>