Zen Cart Logo
Forums / General Questions / This page contains both secure and nonsecure items

This page contains both secure and nonsecure items

Locked

Views: 5,732

Results 21 to 22 of 22
This thread is locked. New replies are disabled.
21 Mar 2007, 6:17 PM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

This page contains both secure and nonsecure items

Because the test that sets the value of is the page secure or not cannot detect it so it says set the:

<base href="http://www.poker-dude.com/" />

This means ... that on the secure page the code that is 2000 miles long to do this detection cannot ...

If you could PM an FTP access and username and password ...

21 Mar 2007, 7:26 PM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: This page contains both secure and nonsecure items

Ajeh:

Ask Network Solution why this code cannot detect if their secure pages are secure:

<?php $request_type = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == '1') || (isset($_SERVER['HTTP_X_FORWARDED_BY']) && strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL')) || (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL')) || (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ) ) ? 'SSL' : 'NONSSL'; echo 'I SEE ' . $request_type; ?>

> **superprg:**
>
> Ajeh, can you tell me why do I get images as http when I click on the lock in FireFox and click on media tab..Is that not the problem?

> **Ajeh:**
>
> Because the test that sets the value of is the page secure or not cannot detect it so it says set the:
> ```php
<base href="http://www.poker-dude.com/" />

This means ... that on the secure page the code that is 2000 miles long to do this detection cannot ...

The code Ajeh posted earlier is what Zen Cart does to detect whether a given page is being served in SSL mode or not. If it is, then Zen Cart sets the base-href value to be https instead of http

However, the Network Solutions configuration fails all of those tests.
Specifically:
a) they do not set SERVER[HTTPS] to "on" or "1" -- they leave it blank
b) they strip SERVER[SCRIPT_URI] so that it shows as http://blah instead of https://blah

(SCRIPT_URI typically translates the same as the URL in the browser address bar, unless the webserver is configured to alter it ... which appears to be what netsol is doing)

In comparing phpinfo and all known $_SERVER output from both their HTTP and HTTPS links to the same page, there are no identifiable differences between the two, and thus there appears to be no way to determine concretely that the page is in fact being served as SSL.