News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Shiflett's Blog:
SERVER_NAME Versus HTTP_HOST
March 17, 2006 @ 06:53:14

On Chris Shiflett's blog, there's a post that looks a an issue that's been brought up on the New York PHP mailing list concerning two variables in the $_SERVER superglobal - SERVER_NAME and HTTP_POST.

The question initially was "arean't these the same thing?" Chris answers:

There were several informative replies within the first few minutes, but there's more to this question than most people realize. In fact, I'm reminded of a blog entry from Zeev last year, where he warns against $_SERVER['SERVER_NAME'].

Zeev suggests that SERVER_NAME is pulled from the Host header from the remote user. Chris reminds us, also, of some disagreements with this view Zeev presented, namely from Rasmus. Chris then gives an example script to illustrate hos things area really handled - the variables use the given values when they're present in the request, but they still do default back to the ServerName when absent (so only in certain circumstances).

0 comments voice your opinion now!
server_name http_post superglobal depends on sent header server_name http_post superglobal depends on sent header


blog comments powered by Disqus

Similar Posts

DevShed: Handling Entries for a Blogger Built with PHP

Vinu Thomas' Blog: MemProxy 0.1 - Memcache Proxy Server in PHP

Bill Staples' Blog: IIS7 Patch for Windows Vista fixes CGI/PHP apps - multiple response headers

PHPMaster.com: REST - Can You do More than Spell It? Part 4

Guilherme Blanco's Blog: register_superglobal("¯name"¯);


Community Events





Don't see your event here?
Let us know!


wordpress community install unittest series code language introduction interview refactor testing list release opinion threedevsandamaybe laravel configure podcast framework developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework