close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Ensuring that basket page always passes to https checkout page?

Thread began 11/28/2014 7:10 am by Nathon Jones Web Design | Last modified 12/03/2014 9:16 am by Jason Byrnes | 910 views | 3 replies |

Nathon Jones Web Design

Ensuring that basket page always passes to https checkout page?

Customer just commented that when they got through to our checkout page it didn't have the https prefix and, therefore, isn't secure.
How do I ensure that the basket page always passes to the https checkout page? Do I simply change this from:

<?php
//WA eCart Redirect Check Out
if (isset($_POST["LEDCart_Checkout"]) || isset($_POST["LEDCart_Checkout_x"])) {
$Redirect_redirStr="checkout.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") < 0) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}

$LEDCart->redirStr = $Redirect_redirStr;
}
$LEDCart->cartAction = "Checkout";
}
?>

to...

<?php
//WA eCart Redirect Check Out
if (isset($_POST["LEDCart_Checkout"]) || isset($_POST["LEDCart_Checkout_x"])) {
$Redirect_redirStr="https:///www.ledwarehouseuk.com/checkout.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") < 0) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}

$LEDCart->redirStr = $Redirect_redirStr;
}
$LEDCart->cartAction = "Checkout";
}
?>

Thank you.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

That is one way to accomplish it.

another would be to use htaccess to force a https redirect or to add php coed to the page to check for https.

see the first 2 answers to this post at stack overflow for examples:
http://stackoverflow.com/questions/85816/how-can-i-force-users-to-access-my-page-over-https-instead-of-http

Sign in to reply to this post

Nathon Jones Web Design

I only need it for the checkout page, which some users can get to outwith https, which is then insecure. It's pretty poor really.
Shouldn't this be something that is in-built into eCart?

I've looked at stackoverflow Jason but as with everything on stackoverflow there are 10 different answers and each one of those answers is usually criticised for being incorrect. :(

I've eventually gone for adding this into the .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.ledwarehouseuk.com/$1 [R,L]

This forces the https for EVERY page, which isn't what I was looking for, but I can't see any way of forcing it for just one page. Can I add the specific URL to the above, like so...

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.ledwarehouseuk.com/checkout.php/$1 [R,L]

Thank you.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

cart does not add this because not all gateway services require it.

if you use one of the remote checkout services, HTTPS is not needed.

if you look at the first response, they give a php code example that you can use on individual pages to force some pages to HTPPS:

<?php
if($_SERVER["HTTPS"] != "on")
{
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
exit();
}
?>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...