Forum Moderators: coopster

Message Too Old, No Replies

php redirect from http to https and back to http

php redirect

         

JetAviator7

4:00 pm on May 24, 2010 (gmt 0)

10+ Year Member



Hi:

I am new to the forum and this has probably been addressed before, but with over 474 pages I hope no one minds my asking a question.

I am a newbie and know little about php; however, I did find a script which I was able to put in the header of a page on my website http://example.com/scheckout.php which changed the page from http to https.

This page then replaces the file checkout.php with a file called confirm.php and then receipt.php.

The website is a Wordpress blog.

When the customer reaches the receipt.php on the scheckout.php I would like to accomplish 2 things:

1. Have the https turn back to http
2. Provide a button to allow the customer to print the receipt

Can you either refer me to where this is already in the forum, or help me with both the php code and where to place it.

Many thanks from a newbie.

John

jatar_k

1:19 pm on May 25, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



is it the scheckout page that changed to https? I would look in the file to see if it checks somewhere near the top for https or http.

from the name of the file though it looks like it is supposed to be a secure checkout, so it seems odd to remove the 'secure'ness of it.

For printing you could look up some javascript to make a print button or you can tell them to hit ctrl-p

JetAviator7

2:24 pm on May 25, 2010 (gmt 0)

10+ Year Member



Sorry, my explanation wasn't complete I guess.

Yes, the scheckout.php page IS supposed to be https:, and I have put php script in the header which properly takes it from http to https - no problem there.

The page then calls several other items called 'confirm' 'receipt' and then 'thank you'.

What I need to do is when we get to the 'thank you' part to have it go back from https to http.

As it currently stands once the scheckout.php page changes from http to https whereever you go on the site from that point on is https.

As I am not familiar with php I do not understand how it changes from the 'checkout' form to the 'confirm', 'receipt' and 'thank you' forms. I don't even know if these are forms.

jatar_k

2:45 pm on May 25, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I might leave the thank you page as https, if this is posted then users would get a warning saying they are leaving secure which might not be a good thing.

Best to keep the full process with the 's' and then provide all of the links on the thank you page as http by providing fully qualified urls.

so <a href="shop.php">keep shopping</a> would need the full url like <a href="http://www.example.com/shop.php">keep shopping</a> that will send them off to the http version and any warnings from the browser won't make them nervous as they have completed the checkout process.

JetAviator7

3:46 pm on May 26, 2010 (gmt 0)

10+ Year Member



Thank you so much - works perfectly!

Regards,

John