473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Redirect from HTTP to HTTPS

114 100+
Dear Friends,

I may take your little bit time to teach me on Credit card information encryption. I know it can be done through SSL certificate. I am very new to SSL Certificate which I need to implement in our website. The SSL certificate is already installed in our hosting web server. I have made a web form in which user will enter his/her credit card information and will be encrypted through ssl certificate in our web server.

I spoke to our web server tech support people and I was told by them that I need to redirect my page from http to https.

for your reference here is the URL:
Highlights of India & Nepal

On the navigation menu Click on 'BOOK NOW' tab. Right now we are getting all the information into our email address.

I don't have any idea about:
  1. What does this mean to redirect from http to https?
  2. How to do it?
Can anyone please help me in this and explain?

Thanks in advance
Deepak
Jan 22 '09 #1
4 2062
Markus
6,050 Expert 4TB
HTTP is the protocol used. You will notice at the beginning of every URL there is usually 'http://'. To make use of your SSL certificate, the protocol needs to be set to 'https://'. So, bearing that in mind, if you have pages on your site that need to be encrypted, make sure to link to it using 'https://yoursite.com'.
Jan 22 '09 #2
Markus
6,050 Expert 4TB
Now I see that you want to redirect to https from http.

You can use $_SERVER['HTTPS'] and check whether it is set to 'on', if it is, then the user is already browsing with https. Otherwise, you can redirect to the same location, but using https as the prefix to the url.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if ( $_SERVER['HTTPS'] != 'on' )
  4. {
  5.     header ( "Location: https://" . $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
  6. }
  7.  
  8. ?>
  9.  
Jan 22 '09 #3
deepaks85
114 100+
Hi Markus,

Thanks for your reply. But still I am confused.

I have two pages one is html pages where form is being created and another is php page where the php script is being written.

I don't know in which page I need to use HTTPS (while opening html page or while sending information to php page)

Please help me.

Here is the php script of the html form:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.   $iata = $_POST['iata_number'];
  4.   $agency = $_POST['agencyName'];
  5.   $agencyadd = $_POST['agencyAddress1'];
  6.   $agencyadd2 = $_POST['agencyAddress2'];
  7.   $agencyCity = $_POST['agencyCity'];
  8.   $agencyState = $_POST['agencyState'];
  9.   $PostalCode = $_POST['agencyPostalCode'];
  10.   $country = $_POST['agencyCountry'];
  11.   $mainPhone = $_POST['mainPhone'];
  12.   $mainFax = $_POST['mainFax'];
  13.   $website = $_POST['website'] ;
  14.   $consortia = $_POST['consortia'];
  15.   $username = $_POST['username'];
  16.   $password =  $_POST['password'];
  17.   $rePassword =  $_POST['rePassword'];
  18.   $email =  $_POST['email'];
  19.   $titleID =  $_POST['titleID'];
  20.   $firstName =  $_POST['firstName'];
  21.   $middleInitial =  $_POST['middleInitial'];
  22.   $lastName =  $_POST['lastName'];
  23.   $address1 =  $_POST['address1'];
  24.   $address2 =  $_POST['address2'];
  25.   $city =  $_POST['city'];
  26.   $state =  $_POST['state'];
  27.   $postalCode =  $_POST['postalCode'];
  28.   $country =  $_POST['country'];
  29.   $workPhone =  $_POST['workPhone'];
  30.   $workPhoneExt =  $_POST['workPhoneExt'];
  31.   $homeBasedAgent =  $_POST['homeBasedAgent'];
  32.   $cardtype = $_POST['cardtype'];
  33.   $cardnumber = $_POST['cardnumber'];
  34.   $cvv = $_POST['cvv'];
  35.   $expmonth = $_POST['expmonth'];
  36.   $expyear = $_POST['expyear'];
  37.   $todayis = date("l, F j, Y, g:i a") ;
  38.  
  39.    $message="$todayis [PST] \n
  40.  
  41.  
  42.   ARC/CLIA/IATA : $iata \n
  43.   Agency Name: $agency \n
  44.   Agency Address: $agencyadd \n
  45.   Agency Address2: $agencyadd2 \n
  46.   Agency City: $agencyCity \n
  47.   Agency State: $agencyState \n
  48.   Postal Code: $PostalCode \n
  49.   Country: $country \n
  50.   Main Phone: $mainPhone \n
  51.   Main Fax: $mainFax \n
  52.   Website: $website \n
  53.   Primary Consortia: $consortia \n\n
  54.  
  55.   User Information \n\n
  56.  
  57.   Username: $username \n
  58.   Password: $password \n
  59.   Re-Password: $rePassword \n
  60.   Email: $email \n
  61.   Title: $titleID \n
  62.   First Name: $firstName \n
  63.   Middle Name: $middleInitial \n
  64.   Last Name: $lastName \n
  65.   Address1: $address1 \n
  66.   Address2: $address2 \n
  67.   City: $city \n
  68.   State: $state \n
  69.   Postal Code: $postalCode \n
  70.   Country: $country \n
  71.   Work Phone: $workPhone \n
  72.   Work Phone Extension: $workPhoneExt \n
  73.   Home Base Agent: $homeBasedAgent \n
  74.   Card Type: $cardtype \n
  75.   Card Number: $cardnumber \n
  76.   CVV Number: $cvv \n
  77.   Expiry Date: $expmonth , $expyear \n";
  78.  
  79.  
  80.  
  81.  
  82.   //mail( "deepaks@onlineres.com", "Form Submission from Brochure Requests at sitatours.com", "Massage: $message",  "From: $email" );
  83.   mail( "siteupdate@onlineres.com", "Book Now Requests at sitatours.com", "Message: $message",  "From: $email" );
  84.  
  85.  
  86.   header( "Location: http://www.sitatours.com/thankyou.html" );
  87. ?>
  88.  
  89.  
  90.  
and here is the html form

http://www.sitatours.com/demo2008/As...s_booknow.html

Thanks

Deepak
Jan 28 '09 #4
Markus
6,050 Expert 4TB
You should use it on all of your pages.
Jan 28 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bob Hansen | last post by:
I am using the following code in my default.asp page to redirect the page from HTTP to HTTPS <% if Request.ServerVariables("HTTPS") = "off" Then Response.Redirect("https://" &...
3
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
8
by: howa | last post by:
a page currently in HTTPS, I force the client to redirect to another page using HTTP under the same domain (e.g. abc.com), i.e. header("Location: http://www.abc.com/index.php"); IE...
0
by: Raven | last post by:
Hi, I have a problem with a server side redirect from a secure page to a non-secure page (same domain name, same folder) I have added some test code that can display the target URL and that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.