Re: [Re: [PHP] user's ip]

2001-08-10 Thread Dave Freeman

On 7 Aug 01, at 14:02, René Moonen wrote:

 The problem is that REMOTE_ADDR returns the IP address of the proxy (if

 if(getenv(HTTP_X_FORWARDED_FOR))
 {
   $ip=getenv(HTTP_X_FORWARDED_FOR);
 }
 else
 {
   $ip=getenv(REMOTE_ADDR);
 }
 $host = gethostbyaddr($ip);

except, perhaps, when there's also a firewall with NAT/MASQ involved - in
that case you'll probably not get much closer than the firewall's IP
address (at least, that's how it is on my network).

CYA, Dave


---
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
---

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [Re: [PHP] user's ip]

2001-08-08 Thread Renze Munnik

On Wed, Aug 08, 2001 at 12:52:42AM +0100, Andreas D. Landmark wrote:
 1) proxies should cache dynamic content
 2) proxies should not retrieve from cache if the request is a force-refresh
 3) proxies should not cache any content which URL includes ?
 
 Sounds like you've got yourself a poor proxy there, I've certainly never
 seen any problem with developing through my proxy, apart from those pesky
 doubleclick ads seem to disappear wonder why...

Main word here is 'should'. Because they do. Ever searched for
headers you can sent for forcing no caching. The one thing you
always find is things like 'they should use this header, but they
don't' or 'one proxy only looks at the headers, others only look at
the contents'. I know how proxies _should_ work, but it turn's out
that there are -to quote you- many poor proxies. And I won't say
that mine isn't one of 'm. But hey... I'm a programmer, not a
system-administrator and stuff like the proxy isn't realy my thing.
I know how they should work and I know we have one. But I also know
(out of experience and theory) that proxies (just like browsers btw)
don't always stick to the standards.
And ehhh... I hardly use URL's including ?. You know... that's the
beauty of sessionhandling. You don't need those ugly URL's anymore.

But... besides proxies one also uses a browser for
Internet-applications. And eventhough you can disable caching and
history and stuff, those damn things _do_ remember things from the
past and they think it's realy convenient to use that. It's quicker
dude! Yeah, well: fuck it! I don't want it to be quicker... I want
it to be right.

-- 

* RzE:

-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [Re: [PHP] user's ip]

2001-08-07 Thread Renze Munnik

On Tue, Aug 07, 2001 at 02:01:04PM +0200, René Moonen wrote:
 The problem is that REMOTE_ADDR returns the IP address of the
 proxy (if the user
 accesses the web-page via a proxy. This will allways return the IP
 address of
 the user's machine:

 if(getenv(HTTP_X_FORWARDED_FOR))
 {
   $ip=getenv(HTTP_X_FORWARDED_FOR);
 }
 else
 {
   $ip=getenv(REMOTE_ADDR);
 }
 $host = gethostbyaddr($ip);



Ahh see, that wasn't clear in the question. Yeah... that's true.
Pain in the ass those proxies. They're also realy useful while
testing your (dynamic) site. NOT!!! Hey, what's this? I thought I'd
realy changed that error. How's this possible?, Didn't I just
change the background-color? Why is it still the same?
BECAUSE THE DAMN PROXY DOESN'T WANT TO SHOW YOU THE NEW VERSION.
No... cache, cache, cache... Damn things always come up with pages
that are (way) to old!

But anyway... that's not what this was about (just my own
frustration). But I just don't use the proxy nomore. Only for
testing things like REMOTE_ADDR etc.

But thank you for specifying the question. And eh, you're right. I
just didn't know the question was about this problem.

--

* RzE:

-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [Re: [PHP] user's ip]

2001-08-07 Thread Andreas D. Landmark

At 07.08.2001 13:06, Renze Munnik wrote:
Ahh see, that wasn't clear in the question. Yeah... that's true.
Pain in the ass those proxies. They're also realy useful while
testing your (dynamic) site. NOT!!! Hey, what's this? I thought I'd
realy changed that error. How's this possible?, Didn't I just
change the background-color? Why is it still the same?
BECAUSE THE DAMN PROXY DOESN'T WANT TO SHOW YOU THE NEW VERSION.
No... cache, cache, cache... Damn things always come up with pages
that are (way) to old!

1) proxies should cache dynamic content
2) proxies should not retrieve from cache if the request is a force-refresh
3) proxies should not cache any content which URL includes ?

Sounds like you've got yourself a poor proxy there, I've certainly never
seen any problem with developing through my proxy, apart from those pesky
doubleclick ads seem to disappear wonder why...


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]