Forum Moderators: coopster
$page_url = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://' .$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING']? '?'. $_SERVER['QUERY_STRING'] : '');
Can anyone see anything that I might be missing? Thank you for any help.
maybe I implemented it wrong, but everything works except picking up the s in https://
print $_SERVER['REMOTE_PORT']
yeilded the following ports in the browser
2485 = normal http://example.com/test.php
2487 = secure layer [example.com...]
print_r($_SERVER);
[example.com...]
yeilded a lot of info and I saw...
[HTTPS] => 1
The other day when I tested this in the secured port
[example.com...] the script picked up the additional www (certificate is registered with www) but only displayed http://www.example.com/test.php
found solution
changed
&& $_SERVER['HTTPS'] == 'on'
to
&& $_SERVER['HTTPS'] == '1'
since 1 was my parameter
[HTTPS] => 1
[edited by: php4U at 8:25 pm (utc) on April 2, 2009]