473,387 Members | 1,864 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,387 software developers and data experts.

$_SERVER['HTTP_HOST'] weird browser problem

Somehow when I am using $_SERVER['HTTP_HOST'] to determine which
subdomain I am on, it works fine in Firefox and not in IE. Doing some
debugging, I found that the string returned was empty for IE, but had
the expected subdomain in Firefox.

I found the same to be true for $_SERVER['SERVER_NAME']

Any idea on how to resolve the issue? I thought that the PHP would be
browser independent since it is processed server-side, but it seems
like IE is not passing headers?

Sep 1 '06 #1
2 1995
op12 wrote:
Somehow when I am using $_SERVER['HTTP_HOST'] to determine which
subdomain I am on, it works fine in Firefox and not in IE. Doing some
debugging, I found that the string returned was empty for IE, but had
the expected subdomain in Firefox.

I found the same to be true for $_SERVER['SERVER_NAME']

Any idea on how to resolve the issue? I thought that the PHP would be
browser independent since it is processed server-side, but it seems
like IE is not passing headers?
Just to let you know ive had the same problem, cant seem to find a
reason why. Can anyone shed any light on this?

Luke.
Sep 1 '06 #2
*** op12 escribió/wrote (31 Aug 2006 22:28:05 -0700):
Somehow when I am using $_SERVER['HTTP_HOST'] to determine which
subdomain I am on, it works fine in Firefox and not in IE. Doing some
debugging, I found that the string returned was empty for IE, but had
the expected subdomain in Firefox.

I found the same to be true for $_SERVER['SERVER_NAME']
Have you enabled display_errors and set error_reporting to E_ALL? Are you
using sessions, cookies or JavaScript?
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Sep 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: junk | last post by:
Hi can anyone tell me why this doesn't work: <link rel="stylsheet" href="http://<?php echo $_SERVER; ?>/includes/test3.css" type="text/css" /> there is no wrap in the actual file. when I...
2
by: ssk | last post by:
Hello! I made a web site using PHP Open sources for message board. Everything's fine except one computer can't open a message writing page. The code that gives an error is the following. ...
6
by: Tom | last post by:
I'm trying to dynamically adjust the path for one of my scripts using this: $script_path = str_replace( $_SERVER, "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR; The problem: the...
10
by: Jim Carlock | last post by:
Looking for a way to extract the path from the pfqpn (partially full qualified path name). $sThisServer = $_SERVER; // returns either aquaticcreationsnc.com or www.aquaticcreationsnc.com ...
7
by: Puneet | last post by:
I really loosing sleep over this one. I have php 4.4 running on Apache 2.... php works fine. phpinfo() retuns everything as it should.. However when I try to print anything using $_SERVER e.g...
6
by: rynato | last post by:
whatever code I put inside this IF statement: if ($_SERVER == 'POST') I get a parse error. Even 'print "something goes here"' doesn't work. Any ideas?
9
by: rajasekhar | last post by:
Hallo, I am developing a site, and here whats the problem is: how to partition the code, i.e. if I developed 1000 lines of code, in that I want to show first 200 lines only if the user opens my...
7
by: Hermann | last post by:
I run a server with apache 1.3 and php 5. Yesterday I notice that sometimes the HTTP_HOST server variable has a comma separated list in it. Let's say my domain name is: www.mydomain.com Usually...
7
by: JC | last post by:
Undefined index: HTTP_HOST This occurs sometimes, is there a reliable method for determining the HTTP_HOST. Not sure if this is something related to Apache or if it's a problem with the version...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.