Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-14 Thread Jamie
> The problem is that this HTTPS variable is not a standard variable > that has been defined. > > Apache's SSL module will only set *a* value to HTTPS if in https is > being used. The value it sets just so happens to be 'on' > > Windows servers (versions unkown) will set 'on' or 'off. > > Other se

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 05:07, Jamie wrote: > > You want to specifically check for > > > > $_SERVER["HTTPS"] == "on" > > > > because if you're not using HTTPS then $_SERVER["HTTPS"] does not exist. > > If this is the case why does it work ok on my windows box? Who cares what happens on a Wind

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Curt Zirzow
* Thus wrote Jamie: > The code im using to test is: > if ($_SERVER["HTTPS"] == "off") > { > print "We are not using HTTPS"; > } > else > { > print "We are using HTTPS"; > } > > > On my windows machine it works as expected with it displaying the correct > message when using https and http. When i

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
> You want to specifically check for > > $_SERVER["HTTPS"] == "on" > > because if you're not using HTTPS then $_SERVER["HTTPS"] does not exist. > If this is the case why does it work ok on my windows box? Shouldnt it have same output accross all platforms? -- PHP General Mailing List (http://

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 04:57, Jamie wrote: > The code im using to test is: > if ($_SERVER["HTTPS"] == "off") > { > print "We are not using HTTPS"; > } > else > { > print "We are using HTTPS"; > } > > > On my windows machine it works as expected with it displaying the correct > message when using

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
> Try $_ENV['HTTPS'] That prints nothing at all on windows and linux. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
The code im using to test is: if ($_SERVER["HTTPS"] == "off") { print "We are not using HTTPS"; } else { print "We are using HTTPS"; } On my windows machine it works as expected with it displaying the correct message when using https and http. When i use my linux box it constantly displays "We ar

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Marek Kilimajer
More about your setup? Try $_ENV['HTTPS'], or access phpinfo() page using https and see what you get. Jamie wrote: Hi, That code I sent is running on a Cobalt Linux server. -Dan Joseph Why does it work for you then and not for me on a rhl 9 setup? On phpinfo I have: SCRIPT_URI https://host.mydo

RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi, Can you post your code so we can look at it? -Dan Joseph > -Original Message- > From: Jamie [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 13, 2004 4:48 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Detecting if browser is using a HTTP or > HTTPS conn

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
> Hi, > > That code I sent is running on a Cobalt Linux server. > > -Dan Joseph > Why does it work for you then and not for me on a rhl 9 setup? >On phpinfo I have: > >SCRIPT_URI > https://host.mydomain.com/phpinfo.php >_SERVER["SCRIPT_URI"] > https://host.mydomain.com/phpinfo.php > >Michael. Ac

RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi, That code I sent is running on a Cobalt Linux server. -Dan Joseph > -Original Message- > From: Jamie [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 13, 2004 3:37 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Detecting if browser is using a HTTP or > HTTPS

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Michael Gale
Hello, What about the following variables: On phpinfo I have: SCRIPT_URI https://host.mydomain.com/phpinfo.php _SERVER["SCRIPT_URI"] https://host.mydomain.com/phpinfo.php Michael. On Tue, 13 Jul 2004 20:37:07 +0100 "Jamie" <[EMAIL PROTECTED]> wrote: > Thanks for your reply Dan, > > I

Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
Thanks for your reply Dan, I have tried the $_SERVER['HTTPS'] on windows and it works fine. It replys off when HTTPS isnt working and on when it is. But on linux it does nothing. Can someone please confirm if this works or it does not work as i need a method that is cross platform compatitable. T

RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi, if ($_SERVER["HTTPS"] != "on") { $newurl = "https://"; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; header("location: $newurl"); die; } That's how I do it.. -Dan Joseph > Is there a way to detect if a browser is using

[PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
Is there a way to detect if a browser is using a HTTPS or HTTP. As i can get the scripts self and the host its running off but i cannot seem to find a way to grab if the connection is secure or not. Thanks for any help in advance Jamie -- PHP General Mailing List (http://www.php.net/) To unsubsc