note 73181 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 20 Apr 2007 14:13:18 +0000 |
| Subject: | note 73181 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125622@lists.php.net to get a copy of this message | ||
Note Submitter: sean at aliencreations dot com
----
I wrote a simplified function to redirect users to a secure version of the page they wish to see.
Just call the function at the top of any page that requires SSL.
function secure_page()
{
if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) !=
'on' )
{
header ('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}
}