note 58206 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:45:17 +0000 |
| Subject: | note 58206 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106708@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();
}
}