Page 1 of 1

How to find http portion of a URL?

Posted: Thu Apr 27, 2006 9:00 am
by uberdragon
Hi everyone,

I want to force a section of a web page to use SSL. In otherwords I was going to header push someone that was visiting http://www.domain.com/checkout.php to https://www.domain.com/checkout.php

I can't seem to find a way to read that part of the url from a PHP environment variable to determine if the script was accessed behind the certificate protected url (https) or not (http)... Any suggestions?

~Uber

Posted: Thu Apr 27, 2006 9:05 am
by feyd
The information is held in $_SERVER in the HTTPS element. If the element is present and not "off" you're in a secured connection.

Posted: Thu Apr 27, 2006 9:26 am
by uberdragon
feyd wrote:The information is held in $_SERVER in the HTTPS element. If the element is present and not "off" you're in a secured connection.
Perfect! Thanks I don't know how I over looked it lol

~Uber