FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Old version trouble with $_SERVER variables?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Old version trouble with $_SERVER variables? [message #179829 is a reply to message #179825] Mon, 10 December 2012 23:41 Go to previous message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma:
Member
Am 2012-12-10 20:05, C meinte:
> What is causing the $host, $realhost and $referer variables to be
> blank?
>
> <?php
>
> global $host;
>
> $date = date("F jS Y, h:iA");
>
> $host=@gethostbyaddr($_SERVER['REMOTE_ADDR']);
>
> if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != "")
> {$realhost =
> @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);}

$HTTP_SERVER_VARS has been deprecated since ages.

> $referer = $_SERVER['$HTTP_REFERER'];

Shouldn't that be $_SERVER['HTTP_REFERER']?
If gethostbyaddr() was coded with the same rigor, it's highly plausible
that the other variables are "empty", too. Which they aren't. Turn on
your error reporting and fix your bugs.

Gregor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simple expression parser for PHP.
Next Topic: test,ignore
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 05:42:40 GMT 2024

Total time taken to generate the page: 0.04125 seconds