php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24515 $_SERVER[remote_addr] different to $remote_addr
Submitted: 2003-07-06 17:50 UTC Modified: 2003-07-18 18:53 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: phpbug at easihosting dot co dot uk Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.3.3RC1 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-07-06 17:50 UTC] phpbug at easihosting dot co dot uk
Description:
------------
When register_globals is on one would expect the registered globals to be the same values as the variables accessed through the global arrays.

$remote_addr doesn't always return the IP of the visitor to the site but the IP of another visitor to another site on the same server.

$server_name doesn't always return the host name for the site being visited, but that of another site being hosted on the same server.

Reproduce code:
---------------
	echo '$SERVER_NAME';
	echo " ";
	echo "$SERVER_NAME";
	echo "<br>";

	echo '$_SERVER[SERVER_NAME]';
	echo " ";
	echo "$_SERVER[SERVER_NAME]";
	echo "<br>";


Expected result:
----------------
$SERVER_NAME www.p800.co.uk
$_SERVER[SERVER_NAME] www.p800.co.uk

Actual result:
--------------
$SERVER_NAME www.p800.co.uk
$_SERVER[SERVER_NAME] www.symbos.co.uk

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-07 08:30 UTC] phpbug at easihosting dot co dot uk
What information do you require? I have read the guidelines, and I seem to have adeared to them, short, simple and not missing anything out.

Did you not understand my bug report or do you think it is not a bug but a feature?

Everytime I get a visitor to my site it sends me an email. It is reporting that they are visiting a different site to what they are. This other site is also hosted on the same server.

I have not found a way to easily reproduce this, I just have to wait and read the emails that report both $_SERVER array and registered global variables.
 [2003-07-09 18:14 UTC] sniper@php.net
Which webserver are you using? 
What was the configure line used?

 [2003-07-10 09:42 UTC] phpbug at easihosting dot co dot uk
Configure:
'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gettext=/usr' '--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin' '--with-zlib' '--enable-magic-quotes' '--with-regex=system' '--with-ttf' '--with-db' '--with-gdbm' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-track-vars' '--with-gd' '--enable-wddx=shared' '--enable-mm=shared' '--enable-xml' '--enable-ftp' '--disable-debug' '--with-libdir=/usr/lib' '--with-pgsql=shared' '--with-pdflib=shared' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--enable-inline-optimization' '--enable-gd-native-ttf' '--with-imap' 

Apache/1.3.6 (Unix) PHP/4.3.3RC2-dev mod_perl/1.21 mod_ssl/2.2.8 OpenSSL/0.9.2b
 [2003-07-10 11:35 UTC] sniper@php.net
Apache 1.3.6 ?!?! The latest and best version is Apache 1.3.27. There are couple of security bugs even in that version you use, UPGRADE it first! (also openssl!)

Also, you use configure options you shouldn't be using:

'--with-regex=system' <-- never use!
'--enable-mm=shared' <-- it's "--with-mm" and it can't be shared.

And these don't even exist:

'--enable-track-vars'
'--enable-mbstr-enc-trans' 


 [2003-07-18 18:53 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC