Click to See Complete Forum and Search --> : What Java-classes are available (or can be made available) in JavaScript?


Valdemar
10-06-2003, 11:27 AM
I'm asking because i found a little script for
getting the client's IP printed.

But it didnt work because it used a Java class.

( i think )

But if I'm totally wrong.. How do I get JavaScript to find
the clients IP?

Val

AdamGundry
10-06-2003, 11:57 AM
Javascript cannot, AFAIK, get the client IP address on its own. You need to use Java or a server-side language such as SSI/PHP for that.

Adam

Valdemar
10-08-2003, 11:59 AM
How do I do it in php then?

Didnt find a nice function at www.php.net...

Help me out?

AdamGundry
10-08-2003, 12:30 PM
It's a predefined variable, actually:

<? echo $_SERVER['REMOTE_ADDR'] ?>

(See the manual (http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server))

Adam