Solved

Does HTTP_HOST work as https ?

Posted on 2009-04-02
1
302 Views
Last Modified: 2012-08-13
Will $_SERVER['HTTP_HOST'] be empty when a php script is accessed from a secure site (https://www.example.com) ?
0
Comment
Question by:level9wizard
1 Comment
 
LVL 6

Accepted Solution

by:
MatthewP earned 500 total points
ID: 24050334
It should do yes, but environment variables are often set by the server and can be different on a per server basis. You can normally use $_SERVER['HTTPS'] which may return a value of 'on' if the page is accessed by HTTPS. To see a list of all environment variables in your server, just put

<?php
phpinfo();
?>

in a php file and call it up through a browser by http and https and see what's available to you.

Matt
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now