On Thu, 19 Apr 2001, elias wrote:

> Hello.
>
> How can i get the IP address of the user who's browsing my current script?
> how can i do it via JavaScript and PHP please.

$REMOTE_ADDR should do the trick (use 'phpinfo()' to see for yourself)

> And if i got an IP address such 192.168.0.2
> i believe it will be returned as a string....Is there is a function to
> encode it to an Integer and the decode it back to a string? or i have to
> code it myself?
>
> -elias

It is a string, so you couldn't make an integer out of it anymore than making
any other string into an integer. The '.' isn't a legal digit.

You'll have to split it up into different blocks (use split)

-- 
Knut
------
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :       91 59 86 06


--
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]

Reply via email to