Solved

Does HTTP_HOST work as https ?

Posted on 2009-04-02
1
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

733 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