Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need php code to see if page is SSL or not.


jhdesign

Recommended Posts

Posted

Hi,

 

I'd like to execute two scripts, one if page is SSL and other if its NOT.

 

I'm wondering if someone can help me out with PHP code.

 

Thanks.

Jacob

Posted

The following lines in application_top.php do this for you already:

 

// set the type of request (secure or not)
 $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

 if ($request_type == 'NONSSL') {
   define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
 } else {
   define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
 }

 

Do not delete this code, but you can see how it is currently done and adjust your code appropriately.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...