[PHP] https detection

2003-10-12 Thread Rosen
Hi,
Is there a way to determite with PHP thath site visitor is in https (SSL)
mode or in normal mode ?

Thanks,
Rosen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Tom Rogers
Hi,

Sunday, October 12, 2003, 9:09:15 PM, you wrote:
R Hi,
R Is there a way to determite with PHP thath site visitor is in https (SSL)
R mode or in normal mode ?

R Thanks,
R Rosen


put phpinfo(32); at the top of the page and that should show what is available
with an ssl connection if you make one.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Rosen
I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection and 80
for normal - i'll be able to determite if user is in https mode - I think
thath should be works . ?

Thanks,
Rosen





 Tom Rogers [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 Sunday, October 12, 2003, 9:09:15 PM, you wrote:
 R Hi,
 R Is there a way to determite with PHP thath site visitor is in https
(SSL)
 R mode or in normal mode ?

 R Thanks,
 R Rosen


 put phpinfo(32); at the top of the page and that should show what is
available
 with an ssl connection if you make one.

 --
 regards,
 Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] https detection

2003-10-12 Thread Tom Rogers
Hi,

Sunday, October 12, 2003, 9:24:40 PM, you wrote:
R I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection and 80
R for normal - i'll be able to determite if user is in https mode - I think
R thath should be works . ?

R Thanks,
R Rosen



looks like a good start :)

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Eugene Lee
On Sun, Oct 12, 2003 at 01:09:15PM +0200, Rosen wrote:
: 
: Is there a way to determite with PHP thath site visitor is in https (SSL)
: mode or in normal mode ?

Check for the existence of $_SERVER['HTTPS'] which gets set only on SSL
pages.  I wonder why it's still not mentioned in the official docs.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Eugene Lee
On Sun, Oct 12, 2003 at 01:24:40PM +0200, Rosen wrote:
: 
: I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection and 80
: for normal - i'll be able to determite if user is in https mode - I think
: thath should be works . ?

Technically, you can't guarantee that anything running over port 443
will be HTTPS.  This is part of the more general problem of running your
web server on non-standard ports.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] https detection

2003-10-12 Thread Tom Rogers
Hi,

Sunday, October 12, 2003, 8:46:41 PM, you wrote:
EL On Sun, Oct 12, 2003 at 01:24:40PM +0200, Rosen wrote:
EL : 
EL : I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection and 80
EL : for normal - i'll be able to determite if user is in https mode - I think
EL : thath should be works . ?

EL Technically, you can't guarantee that anything running over port 443
EL will be HTTPS.  This is part of the more general problem of running your
EL web server on non-standard ports.


His script will only see valid ssl connections as all other attempts should be
ditched by apache or whatever before php gets involved...in theory anyway :)

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Eugene Lee
On Sun, Oct 12, 2003 at 08:52:30PM +1000, Tom Rogers wrote:
: Sunday, October 12, 2003, 8:46:41 PM, Eugene wrote:
: EL On Sun, Oct 12, 2003 at 01:24:40PM +0200, Rosen wrote:
: EL : 
: EL : I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection
: EL : and 80 for normal - i'll be able to determite if user is in https
: EL : mode - I think thath should be works . ?
: 
: EL Technically, you can't guarantee that anything running over port 443
: EL will be HTTPS.  This is part of the more general problem of running your
: EL web server on non-standard ports.
: 
: His script will only see valid ssl connections as all other attempts should be
: ditched by apache or whatever before php gets involved...in theory anyway :)

Unless Apache is configured so that both SSL and non-SSL virtualhosts
to point to the same directory containing said script, or said script is
shared (via PHP include(), require(), etc.) by other PHP scripts in both
SSL and non-SSL virtualhosts.  :-)

And $_SERVER['HTTPS'] is so much easier to check for existence!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] https detection

2003-10-12 Thread Tom Rogers
Hi,

Sunday, October 12, 2003, 10:27:21 PM, you wrote:

EL Unless Apache is configured so that both SSL and non-SSL virtualhosts
EL to point to the same directory containing said script, or said script is
EL shared (via PHP include(), require(), etc.) by other PHP scripts in both
EL SSL and non-SSL virtualhosts.  :-)

EL And $_SERVER['HTTPS'] is so much easier to check for existence!

I couldn't remember what variables were set so I said to use phpinfo and see
what pops upyou are probably right :)

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] https detection

2003-10-12 Thread Curt Zirzow
* Thus wrote Rosen ([EMAIL PROTECTED]):
 I.e. if  I use _SERVER[SERVER_PORT] = 443  - for https connection and 80
 for normal - i'll be able to determite if user is in https mode - I think
 thath should be works . ?

There is no guarantee that port 443 == https and 80 == http.

Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php