[thelist] Testing for secure connection in PHP

Carl Edwards edwards at vitesse.com
Fri Apr 16 18:45:29 CDT 2004


Hello,

I use the following snippet:

 if ($_SERVER['HTTPS'] !== 'on') {
       die("Must be run under a secure connection, ie https.\n");
 }

-Carl Edwards


>  -----Original Message-----
>  From: Tony Grimes [mailto:info at scribenewmedia.com]
>  Sent: Friday, April 16, 2004 3:24 PM
>  To: thelist
>  Subject: [thelist] Testing for secure connection in PHP
>  
>  
>  I've got a credit card payment page that needs to be on a 
>  secure connection.
>  Is there any way to test to make sure that the user has 
>  connected to the
>  page via https?
>  
>  The only way I can think of is test which server port is 
>  used, but I don't
>  want it to depend on the server config. Is there a more 
>  reliable way to test
>  this in PHP?
>  
>  Tony
>  
>  -- 
>  * * Please support the community that supports you.  * *
>  http://evolt.org/help_support_evolt/
>  
>  For unsubscribe and other options, including the Tip Harvester 
>  and archives of thelist go to: http://lists.evolt.org 
>  Workers of the Web, evolt ! 
>  


More information about the thelist mailing list