Users IP on PHP3? – PHP

  php

Q(Question):

I have a project and PHP 3.0.12 is installed…rediculous I know, but its
not my fault.

what is the syntax for getting the visiting users IP? Nothing I try seems to
work.

Thanks in Advance,
Karl

A(Answer):

* "Karl Hungus" <nn*********@hotmail.com> wrote:

I have a project and PHP 3.0.12 is installed…rediculous I know, but its
not my fault.

what is the syntax for getting the visiting users IP? Nothing I try seems to
work.

It is availeable in
$_SERVER[REMOTE_HOST]
martin


Are you Anonymous? Where? … I don’t think so …

[ devnull{at}chaosfactory{dot}org | http://www.chaosfactory.org/ ]

A(Answer):

Karl Hungus wrote:

I have a project and PHP 3.0.12 is installed…rediculous I know, but its
not my fault.

what is the syntax for getting the visiting users IP? Nothing I try seems to
work.

Try
$_SERVER[‘REMOTE_ADDR’]

But, that can be the IP address of the proxy they use.

If I were to go to your page you’d get the same address as anybody else
coming from the same city and provider I’m in — the address of our
provider &^##$^% http-proxy!

–= my mail box only accepts =–
–= Content-Type: text/plain =–
–= Size below 10001 bytes =–

A(Answer):

$_SERVER will not work on php3 at all.

"Note: Introduced in 4.1.0. In earlier versions, use $HTTP_SERVER_VARS"

http_server_vars doesnt work either

Try
$_SERVER[‘REMOTE_ADDR’]

But, that can be the IP address of the proxy they use.

If I were to go to your page you’d get the same address as anybody else
coming from the same city and provider I’m in — the address of our
provider &^##$^% http-proxy!

–= my mail box only accepts =–
–= Content-Type: text/plain =–
–= Size below 10001 bytes =–

A(Answer):

On Wed, 25 Feb 2004 23:26:41 +0100, Martin Buchleitner
<de*****@chaosfactory.org> wrote:

* "Karl Hungus" <nn*********@hotmail.com> wrote:

I have a project and PHP 3.0.12 is installed…rediculous I know, but its
not my fault.

what is the syntax for getting the visiting users IP? Nothing I try seems to
work.

It is availeable in
$_SERVER[REMOTE_HOST]

No it isn’t.


Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

A(Answer):

On Wed, 25 Feb 2004 22:23:47 GMT, "Karl Hungus" <nn*********@hotmail.com>
wrote:

I have a project and PHP 3.0.12 is installed…rediculous I know, but its
not my fault.

what is the syntax for getting the visiting users IP? Nothing I try seems to
work.

Hm, even ‘get_defined_vars’ doesn’t work way back in PHP3.

Is there anything in the output of phpinfo() you could work with? Is
$REMOTE_ADDR set as a global variable?


Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

A(Answer):

Yeah, I can use the global variables. thanks.

Is there anything in the output of phpinfo() you could work with? Is
$REMOTE_ADDR set as a global variable?


Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

LEAVE A COMMENT