473,404 Members | 2,137 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,404 software developers and data experts.

PHP Redirect Problem

Hello everyone,

If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
around on the internet and couldn't find that much of a help. What am I
missing? Any help would be appreciated...

Thanks

Aug 18 '06 #1
8 3300
mark babli wrote:
Hello everyone,

If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
around on the internet and couldn't find that much of a help. What am I
missing? Any help would be appreciated...

Thanks


$_SERVER['HOST'] is not a valid value (at least not for Apache).

If you're talking about $_SERVER['HTTP_HOST'] it is only supposed to
return the domain (i.e. 'www.example.com').

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 18 '06 #2
*** mark babli escribió/wrote (Fri, 18 Aug 2006 18:03:24 GMT):
If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to a
php file, why is it that $_SERVER['HOST'] returns only the domain?
That what a host is, a computer. It *must* be an IP address or domain name.
In any case, you can get a list of $_SERVER values with:

<?

print_r($_SERVER);

?>

Find there whatever you need (I don't think "HOST" is in the list).

--
-+ 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
--
Aug 18 '06 #3
Thanks a million. I'll make sure to read what the return values are from now
on... Newbie :-^

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:5o******************************@comcast.com. ..
mark babli wrote:
>Hello everyone,

If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to
a php file, why is it that $_SERVER['HOST'] returns only the domain? I
looked around on the internet and couldn't find that much of a help.
What am I missing? Any help would be appreciated...

Thanks

$_SERVER['HOST'] is not a valid value (at least not for Apache).

If you're talking about $_SERVER['HTTP_HOST'] it is only supposed to
return the domain (i.e. 'www.example.com').

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

Aug 18 '06 #4
Thanks a million,

That is exactly what I was looking for, I appreciate your help.
"Alvaro G. Vicario" <we*******@NOSPAMdemogracia.comwrote in message
news:80*****************************@40tude.net...
*** mark babli escribió/wrote (Fri, 18 Aug 2006 18:03:24 GMT):
> If I were to redirect users in HTML using <Meta HTTP_EQUIV... Tag to
a
php file, why is it that $_SERVER['HOST'] returns only the domain?

That what a host is, a computer. It *must* be an IP address or domain
name.
In any case, you can get a list of $_SERVER values with:

<?

print_r($_SERVER);

?>

Find there whatever you need (I don't think "HOST" is in the list).

--
-+ 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
--

Aug 18 '06 #5
On Fri, 18 Aug 2006 20:59:46 +0200, "Alvaro G. Vicario"
<we*******@NOSPAMdemogracia.comwrote:
><?
^^^

Tsk tsk... you of course mean "<?php"

;-)

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 18 '06 #6
*** Andy Hassall escribió/wrote (Fri, 18 Aug 2006 23:02:15 +0100):
>><?
^^^

Tsk tsk... you of course mean "<?php"

;-)
I hate fundamentalists so much :)
--
-+ 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
--
Aug 18 '06 #7
Ha.................. :-\
"Alvaro G. Vicario" <we*******@NOSPAMdemogracia.comwrote in message
news:1t*****************************@40tude.net...
*** Andy Hassall escribió/wrote (Fri, 18 Aug 2006 23:02:15 +0100):
>>><?
^^^

Tsk tsk... you of course mean "<?php"

;-)

I hate fundamentalists so much :)
--
-+ 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
--

Aug 18 '06 #8

mark babli wrote:
php file, why is it that $_SERVER['HOST'] returns only the domain? I looked
$_SERVER['HTTP_HOST'] would show you the alias, domain and top-level
domain ->
www is an alias to a computer or computers
domain is a ... domain
top-level domain is/are .com .net .edu .cc .us .... etc ... etc

print_r($Server) works, but phpinfo(32) is easier to read IMO

todh

Aug 18 '06 #9

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

Similar topics

5
by: Steve Lutz | last post by:
Hello, I have a page that creates a class, and then on certain conditions, redirects user to another page. The class has a Class_Terminate() function that saves itself to a database. The class...
3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
1
by: Peter Kirk | last post by:
Hi there I have a program written by another company (it's a "web control" which returns a web-page: can I compare this to a servlet in the Java world?), which they think is causing problems on...
2
by: news://news.microsoft.com/microsoft.public.de.germ | last post by:
Hallo! Ich habe ein Frameset mit 3 Frames. Im 1. Frame wird eine ASPX-Seite geöffnet. In dieser werden einige Steuerelemente angezeigt. Nun soll bei bestimmten Benutzeraktivitäten eine andere...
5
by: Alan Silver | last post by:
Hello, I have a page that is supposed to do some checking, and if OK, set a session variable before redirecting to another page. The following code is a simplified version, I have hard-coded the...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
5
by: =?Utf-8?B?d2ViZ3V5QGNvbW11bml0eS5ub3NwYW0=?= | last post by:
We have been running into some problems where using Response.Redirect causes the page to hang and it never actually redirects. Here's the scenario: User opens the page, selects an item from the...
12
by: =?Utf-8?B?cGI=?= | last post by:
I am having trouble doing a redirect in an async asp.net implemention. Most of the time it works, but when it doesn't it just "hangs", the browser never gets any return page. If I run it under the...
6
by: sjledet | last post by:
I'm trying to figure out what I have wrong in the following code. It's located at http://www.ledet.com/locations/location.aspx If I call this page with...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.