Forum Moderators: coopster

Message Too Old, No Replies

adding scripts to https

         

JuicyScript

8:50 pm on Jan 24, 2010 (gmt 0)

10+ Year Member



Can u add secure webpage to php...Am talking abt HTTPS
Example:
[codeproject.com...]
To make it secure

rocknbil

12:53 am on Jan 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?php
if (! ($_SERVER['HTTPS']=='on')) {
header("Location:https://example.com/script.php");
}
?>

Where script.php is the current script. Be sure to use the full URL.

You could to a case insensitive preg_match for "on" but once it works, it works . . .