Re: [PHP] Verifying a url

2004-01-07 Thread Christophe Chisogne
Kelly Hallman wrote:
$is_secure = ($_SERVER['SERVER_PORT']==443) ? true : false ;
which can be written more simply

$is_secure = $_SERVER['SERVER_PORT']==443;

Christophe

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


Re: [PHP] Verifying a url

2004-01-07 Thread Marek Kilimajer
There is a official variable - $_SERVER['HTTPS'] - that is defined 
only if https protocol is used.

Ivo Pletikosic wrote:

It did not work for me but since I have only one http port and one https
port on my server i use instead
if( $_SERVER['SERVER_PORT'] == 80 ) echo 'http';

C.



-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 06, 2004 6:56 PM
To: Thomas Andersen
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Verifying a url

Hello Thomas,

Wednesday, January 7, 2004, 2:49:48 AM, you wrote:

TA My web site has two different ways to be accessed.  One 
is through a SSL
TA connection and the other not.

TA Does anyone know how to check either the URL that is 
being used (https would
TA give away the SSL) or if you can check if SSL is being used?

I'm pretty sure the following would work:

if ($_SERVER['SERVER_PROTOCOL'] == HTTP/1.1)
{
echo Normal site;
}
--
Best regards,
Richardmailto:[EMAIL PROTECTED]


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


[PHP] Verifying a url

2004-01-06 Thread Thomas Andersen
Hi,

My web site has two different ways to be accessed.  One is through a SSL
connection and the other not.

Does anyone know how to check either the URL that is being used (https would
give away the SSL) or if you can check if SSL is being used?

Thanks,
Thomas

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



Re: [PHP] Verifying a url

2004-01-06 Thread Richard Davey
Hello Thomas,

Wednesday, January 7, 2004, 2:49:48 AM, you wrote:

TA My web site has two different ways to be accessed.  One is through a SSL
TA connection and the other not.

TA Does anyone know how to check either the URL that is being used (https would
TA give away the SSL) or if you can check if SSL is being used?

I'm pretty sure the following would work:

if ($_SERVER['SERVER_PROTOCOL'] == HTTP/1.1)
{
 echo Normal site;
}

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: [PHP] Verifying a url

2004-01-06 Thread Ivo Pletikosic
It did not work for me but since I have only one http port and one https
port on my server i use instead

if( $_SERVER['SERVER_PORT'] == 80 ) echo 'http';

C.


 -Original Message-
 From: Richard Davey [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 06, 2004 6:56 PM
 To: Thomas Andersen
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Verifying a url
 
 
 Hello Thomas,
 
 Wednesday, January 7, 2004, 2:49:48 AM, you wrote:
 
 TA My web site has two different ways to be accessed.  One 
 is through a SSL
 TA connection and the other not.
 
 TA Does anyone know how to check either the URL that is 
 being used (https would
 TA give away the SSL) or if you can check if SSL is being used?
 
 I'm pretty sure the following would work:
 
 if ($_SERVER['SERVER_PROTOCOL'] == HTTP/1.1)
 {
  echo Normal site;
 }
 
 -- 
 Best regards,
  Richardmailto:[EMAIL PROTECTED]

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



RE: [PHP] Verifying a url

2004-01-06 Thread Kelly Hallman
On Tue, 6 Jan 2004, Ivo Pletikosic wrote:
 It did not work for me but since I have only one http port and one https
 port on my server i use instead
 
 if( $_SERVER['SERVER_PORT'] == 80 ) echo 'http';

Here's a way you could write it in your script...
$is_secure = ($_SERVER['SERVER_PORT']==443) ? true : false ;

If you decide to use SERVER_PORT to sense secure connections, this logic 
would work well. It only depends on knowing the port you consider secure.
For typical https, that would be port 443. Enjoy!

-- 
Kelly Hallman
// Ultrafancy

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