I have asked this question previously and have implemented what was responded per tek-tips replies.
How do I HTTPS protect a directory or a couple of web pages on my website.
Meaning. I have a website that has a checkout page, it is located at /var/ how do I protect checkout with a redirect from HTTP to HTTPS..
I currently have the following code in my index.php (this code snipit is located at the top of the index.php file) page located at /var/
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS']!="on")
{
$header = "Location: [SERVER_NAME].$_SERVER[REQUEST_URI];
header($header);
exit;
}
$user_login = "";
if(isset($_REQUEST['user_login'])){
$user_login = $_REQUEST['user_login'];
if (isset($_REQUEST['username'])){
session_start();
$HTTP_SESSION_VARS['valid_user'] = $_REQUEST['username'];
$username = $HTTP_SESSION_VARS['valid_user'];
}
}
But this protects the entire site. I do find it annoying that a Windows Security Information gui pops up all the time stating "This page contains both secure and nonsecure items. Do you want to display the nonsecure items>"
I have two files located /var/ and checkout2.php.. Can I protect the entire /checkout dir or would you suggest I only HTTPS checout1.php and checkout2.php?
Either way can some instructions be provided as to the what and how. Thanks so much...
How do I HTTPS protect a directory or a couple of web pages on my website.
Meaning. I have a website that has a checkout page, it is located at /var/ how do I protect checkout with a redirect from HTTP to HTTPS..
I currently have the following code in my index.php (this code snipit is located at the top of the index.php file) page located at /var/
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS']!="on")
{
$header = "Location: [SERVER_NAME].$_SERVER[REQUEST_URI];
header($header);
exit;
}
$user_login = "";
if(isset($_REQUEST['user_login'])){
$user_login = $_REQUEST['user_login'];
if (isset($_REQUEST['username'])){
session_start();
$HTTP_SESSION_VARS['valid_user'] = $_REQUEST['username'];
$username = $HTTP_SESSION_VARS['valid_user'];
}
}
But this protects the entire site. I do find it annoying that a Windows Security Information gui pops up all the time stating "This page contains both secure and nonsecure items. Do you want to display the nonsecure items>"
I have two files located /var/ and checkout2.php.. Can I protect the entire /checkout dir or would you suggest I only HTTPS checout1.php and checkout2.php?
Either way can some instructions be provided as to the what and how. Thanks so much...