note 18503 added to language.variables.predefined
| From: | kmckay at aimentertainment dot com | Date: | Fri, 25 Jan 2002 19:18:32 +0000 |
| Subject: | note 18503 added to language.variables.predefined | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25813@lists.php.net to get a copy of this message | ||
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
?>
--
http://www.php.net/manual/en/language.variables.predefined.php
http://master.php.net/manage/user-notes.php?action=edit+18503
http://master.php.net/manage/user-notes.php?action=delete+18503
http://master.php.net/manage/user-notes.php?action=reject+18503