No! I can encode IP address to an Integer:
192.168.0.1 consider as: a.b.c.d
and now the formula goes:
a shl 24 + b shl 16 + c shl 8 + d
but i was looking for something ready made....
-elias
http://www.kameelah.org/eassoft
""Knut H. Hassel Nielsen"" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
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]
--
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]