[System Specs]
PHP Version 4.1.2
Server API = CGI
OpenSSL Version = 0.9.6b
Apache 2.0.44 (Unix) - Linux server
SSL is enabled and working on the server
Display Errors: On
Error Level: Not E_ALL
Register Globals: On (should be and will be turned off soon, heh)
There have been no changes to the server specs other than a 'storage space' upgrade.
I've searched the web, Phuse, checked various php manuals/books, searched various forums, but I can't find a clue as to what's
wrong with the following code. I'm relatively new to php and I don't know anyone else who codes so you folks are my last resort
I've placed this code (and many variants) in a .php page on my server and it always returns a 'false', even though SSL is enabled and working on the server. If I type "https://...mytestpageaddress..." into the address bar of the browser (I've tried 4 different browsers just to see if my browser config was wonky) the https page loads fine except I get the "Must be a secure connection" line. This code has always returned a "Hello" when the page request came in from https, but for some reason it now does not. All I need to do is detect if https is on; really I'm just curious as to what I'm doing wrong...
Code: Select all
<?php
if ($_SERVER['HTTPS'] !== 'on') {
die("Must be a secure connection.");
}
echo 'HELLO!';
exit;
?>Code: Select all
<?php
if ('on' == $_SERVER['HTTPS']) {
print "SSL enabled.";
} else {
print "Must be a secure connection.";
}
?>Thanks in advance for the help!
Vox