/ Published in: PHP

This 'Check if HTTPS is on in PHP' script accounts for servers which set HTTPS differently. Some servers do not set HTTPS, others set it to 'off', etc. Only checking if HTTPS is on will cause an 'undefined index error' in these cases.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$protocol = 'https://'; } else { $protocol = 'http://'; }
URL: check_if_https_is_on_in_php
Comments
