Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

Does HTTP_HOST work as https ?

Will $_SERVER['HTTP_HOST'] be empty when a php script is accessed from a secure site (https://www.example.com) ?
0
level9wizard
Asked:
level9wizard
1 Solution
 
MatthewPCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now