note 51111 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:52:31 +0000 |
| Subject: | note 51111 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106731@lists.php.net to get a copy of this message | ||
Note Submitter: oto_brglez_ml at hotmail dot com
----
I'm using this lines to force users of my page to use SSL. U can set variable $SSL to true if u
want SSL and false if u don't. This snippet is from my login page where i want to use SSL.
$SSL = true;
if($SSL){ /* I want to use SSL on my page */
if($_SERVER["HTTPS"] == 'on'){ /* SSL is used */
/* User exists so let's send header and rederect him to page zoox.php */
if($_SESSION['id']!=''){ header("Location: zoox.php"); };
} else {
/* SSL is not used so rederect him to this page this time with SSL */
header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]);
};
} else { /* I don't want to use SSL on my page */
/* User exists so let's go to zoox.php without SSL */
if($_SESSION['id']!='') header("Location: zoox.php");
};