473,624 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined index: HTTP_HOST

JC
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 of PHP.

Apache version 1.3.37
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.

--
JC
Natural Cure For Pink-Eye (Conjunctivitis )
http://www.associatedcontent.com/art...nctivitis.html
Jul 28 '08 #1
7 24579
JC wrote:
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 of PHP.

Apache version 1.3.37
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.
From the top of my head, The HTTP_HOST is the host: header that is
compulsory for HTTP/1.1 requests. What you experience are probably
HTTP/1.0 requests. Nothing to do with either apache or PHP.

Best regards
Jul 28 '08 #2
JC wrote:
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 of PHP.

Apache version 1.3.37
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.
Are you running PHP as a module or CGI? There are some values which
aren't defined in the CGI. I don't recall offhand if HTTP_HOST is one
of them (I use modules).

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 28 '08 #3
Jerry Stuckle wrote:
JC wrote:
>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 of PHP.

Apache version 1.3.37
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.

Are you running PHP as a module or CGI? There are some values which
aren't defined in the CGI. I don't recall offhand if HTTP_HOST is one
of them (I use modules).
Aw, @#$%. Forget what I said. It's been a long day. It very well
could be HTTP 1.0 is being used. Check your apache access logs and see
what they say.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 28 '08 #4
JC
JC wrote:
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 of PHP.

Server version: Apache/1.3.34 (Win32) <- CORRECTED. Is NOT 1.3.37.
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.
"Jerry Stuckle" replied...
It could be HTTP 1.0 is being used. Check your apache access logs
and see what they say.
PHP is installed and run as/through a DLL ("ISAPI" is the IIS term,
right, or does that applie to Apache too?).

Yes, thanks. I could not find the access in the Apache logs. I
corrected the Apache version above. It's time to install version 2,
instead of hanging onto the version 1. I've run version on other
systems in the recent past.

I did get Internet Explorer to throw HTTP 1.0 headers, so I tested that.

$_SERVER['HTTP_HOST'] displays properly. So I'm limiting what's going
on to one of the following:

(1)
Someone is accessing through another server where I can't get HTTP_HOST
headers. Don't know exactly how that happens so I'm just throwing out
pure conjecture here.

(2)
There's an HTTP_HOST problem with a current version of PHP.

(3)
There's an HTTP_HOST problem with Apache. I hesitate to mention Apache
because this has been happened on different versions of Apache (including
version 2.2.x which I recently tested).

(4)
The HTTP_HOST header gets lost somewhere, sometimes.

I only recently started using $_SERVER['HTTP_HOST'] and the problems show
up in the PHP error logs. So far I have not been able to identify where
it ended up logged in the Apache logs.

Is there another way to identify which host gets connected to (PHP question)?

Has anyone else noticed such? Maybe it's been happening all along, and it's
only because I just started relying upon it to identify the domain-name that
gets connected to. I would like to host 12 domains using one page which uses
HTTP_HOST to identify which VirtualHost was connected to.

Thanks for ANY and ALL suggestions, replies, hints, comments.

--
JC
Natural Cure For Pink-Eye (Conjunctivitis )
http://www.associatedcontent.com/art...nctivitis.html


Jul 29 '08 #5
JC wrote:
JC wrote:
>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 of PHP.

Server version: Apache/1.3.34 (Win32) <- CORRECTED. Is NOT 1.3.37.
PHP version 5.2.4

I'm currently searching for an upgrade to Apache.

"Jerry Stuckle" replied...
>It could be HTTP 1.0 is being used. Check your apache access logs
and see what they say.

PHP is installed and run as/through a DLL ("ISAPI" is the IIS term,
right, or does that applie to Apache too?).

Yes, thanks. I could not find the access in the Apache logs. I
corrected the Apache version above. It's time to install version 2,
instead of hanging onto the version 1. I've run version on other
systems in the recent past.

I did get Internet Explorer to throw HTTP 1.0 headers, so I tested that.

$_SERVER['HTTP_HOST'] displays properly. So I'm limiting what's going
on to one of the following:

(1)
Someone is accessing through another server where I can't get HTTP_HOST
headers. Don't know exactly how that happens so I'm just throwing out
pure conjecture here.

(2)
There's an HTTP_HOST problem with a current version of PHP.

(3)
There's an HTTP_HOST problem with Apache. I hesitate to mention Apache
because this has been happened on different versions of Apache (including
version 2.2.x which I recently tested).

(4)
The HTTP_HOST header gets lost somewhere, sometimes.

I only recently started using $_SERVER['HTTP_HOST'] and the problems show
up in the PHP error logs. So far I have not been able to identify where
it ended up logged in the Apache logs.

Is there another way to identify which host gets connected to (PHP question)?

Has anyone else noticed such? Maybe it's been happening all along, and it's
only because I just started relying upon it to identify the domain-name that
gets connected to. I would like to host 12 domains using one page which uses
HTTP_HOST to identify which VirtualHost was connected to.

Thanks for ANY and ALL suggestions, replies, hints, comments.
Is this the default website for your host? Is it possible they are
accessing it via the ip address? Even possibly with a script or telnet
session?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jul 29 '08 #6
JC
"Jerry Stuckle" asked:
Is this the default website for your host? Is it possible they
are accessing it via the ip address? Even possibly with a script or
telnet session?
Right at the moment it's not occuring all that often, a couple times
a day at the most, if any.

The default site is the IP address (the IP address is listed as the
first VirtualHost and as the ServerName before any VirtualHost).

Oops, wrong IP address was listed there. Maybe that corrects all.

Thanks, Jerry.

--
JC
Natural Cure For Pink-Eye (Conjunctivitis )
http://www.associatedcontent.com/art...nctivitis.html
Jul 29 '08 #7
(4)
The HTTP_HOST header gets lost somewhere, sometimes.

I only recently started using $_SERVER['HTTP_HOST'] and the problems show
up in the PHP error logs. So far I have not been able to identify where
it ended up logged in the Apache logs.

Is there another way to identify which host gets connected to (PHP question)?

Has anyone else noticed such? Maybe it's been happening all along, and it's
only because I just started relying upon it to identify the domain-name that
gets connected to. I would like to host 12 domains using one page which uses
HTTP_HOST to identify which VirtualHost was connected to.

Thanks for ANY and ALL suggestions, replies, hints, comments.
I'm not sure I understand the question, but I tested with:
echo "HTTP_HOST is " . getenv('HTTP_HO ST') . ":<br>";
and it seems to work.
/bb
Jul 30 '08 #8

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

Similar topics

1
108830
by: lawrence | last post by:
I just switched error_reporting to ALL so I could debug my site. I got a huge page full of errors. One of the most common was that in my arrays I'm using undefined offsets and indexes. These still work fine, but with error reporting at all they are marked as errors. Why? What am I doing wrong? www.monkeyclaus.org
4
7179
by: John Oliver | last post by:
PHP Notice: Undefined index: name in /home/www/reformcagunlaws.com/new.php on line 6 PHP Notice: Undefined index: address in /home/www/reformcagunlaws.com/new.php on line 7 PHP Notice: Undefined index: city in /home/www/reformcagunlaws.com/new.php on line 8 PHP Notice: Undefined index: county in /home/www/reformcagunlaws.com/new.php on line 9 PHP Notice: Undefined index: zip in /home/www/reformcagunlaws.com/new.php on line...
3
4960
cassbiz
by: cassbiz | last post by:
Here are the errors that are coming up in my error_log Notice: Undefined index: andatum in /zipcode.php on line 11 Notice: Undefined index: andatum in /zipcode.php on line 12 Notice: Undefined index: abdatum in /zipcode.php on line 13 Notice: Undefined index: zimmer in /zipcode.php on line 14 Notice: Undefined index: city in /zipcode.php on line 39 Notice: Undefined index: state in /zipcode.php on line 41
3
5490
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice: Undefined index: FriendName in D:\Yan\Over_8\SendEmail.php on line 4, Notice: Undefined index: FriendEmail in D:\Yan\Over_8\SendEmail.php on line 5, Notice: Undefined index: Name in D:\Yan\Over_8\SendEmail.php on line 6, Notice: Undefined index: Email...
15
4460
by: bill | last post by:
I am trying to write clean code but keep having trouble deciding when to quote an array index and when not to. sometimes when I quote an array index inside of double quotes I get an error about enased whitespace (to my best memory) AT other times I get an undefined index notice as below: Notice: Undefined index: last_reminder_id in...
5
7178
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my local server it was working fine but giving some errors those are Notice: Undefined index: phplogin in C:\Inetpub\wwwroot\sampleft\index.php on line 116 Notice: Undefined variable: username in C:\Inetpub\wwwroot\sampleft\index.php on line 116 ...
3
3865
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if (empty($info)) { $info='noinfo'; } changeinfo($info); Hey everyone, I keep getting an error regarding the above code. These are the errors: Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5
3
5991
by: razvanel442 | last post by:
Hi all i am new here! I take a look on forum but i don't found a the answer for my problem ok this is my problem: Line47:$user = $_GET; Line48:$pass = $_GET; Line49:$char = $_GET;
3
2026
by: mediator | last post by:
Hello I have a php contact email form on my a ecommerce shop website ! I am getting a Undefined index error messages coming from the top of the php code, the email form its self works fine, HERE IS THE ERROR MESSAGES Notice: Undefined index: Name in E:\domains\t\tools2diy.co.uk\user\htdocs\contact.php on line 13 Notice: Undefined index: Tel in E:\domains\t\tools2diy.co.uk\user\htdocs\contact.php on line 14
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.