Re: https forced redirect question

From: Date: Fri, 15 Feb 2008 20:05:40 +0000
Subject: Re: https forced redirect question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-269374@lists.php.net to get a copy of this message
On Fri, 2008-02-15 at 14:58 -0500, nihilism machine wrote: > why isnt this redirecting my page to https://www.mydomain.com > instead > the page stays at my domain.com > <?php > > class URL { > > // Public Variables > public $HTTPS; > public $ServerName; > public $WWW; > > // Public Functions > > public function __construct() { > $this->checkHTTPS(); > $this->checkWWW(); > $this->ServerName = $_SERVER['SERVER_NAME']; > } > > // Check if HTTPS > public function checkHTTPS() { > if ($_SERVER['HTTPS'] != "on") { > $this->HTTPS = false; > } else { > $this->HTTPS = true; > } > } > > // Redirect to HTTPS Site > public function HTTPSRedirect() { > if($this->HTTPS = false) { Because you're assigning false. Some people switch the order of the operands so that a typoe like this generates an order. Personally, I just live on the edge ;) Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#269374) next »