note 73181 added to function.header
| From: | sean at aliencreations dot com | Date: | Mon, 12 Feb 2007 15:47:32 +0000 |
| Subject: | note 73181 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123281@lists.php.net to get a copy of this message | ||
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();
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 76.21.96.242
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/73181
Del: integrated -- https://master.php.net/note/delete/73181/integrated
Del: useless -- https://master.php.net/note/delete/73181/useless
Del: bad code -- https://master.php.net/note/delete/73181/bad+code
Del: spam -- https://master.php.net/note/delete/73181/spam
Del: non-english -- https://master.php.net/note/delete/73181/non-english
Del: in docs -- https://master.php.net/note/delete/73181/in+docs
Del: other reasons-- https://master.php.net/note/delete/73181
Reject -- https://master.php.net/note/reject/73181
Search -- https://master.php.net/manage/user-notes.php