RE: [PHP] I.P. range authentication

2003-03-19 Thread Ernest E Vogelsinger
At 02:51 19.03.2003, John W. Holmes said: [snip] >> $abytes = explode('.', $ip); // explode the IP string >> $ip = 0; >> foreach ($abytes as $byte) $ip = ($ip << 8) + $byte; >> >> This will give you the valid numeric equivalent of the IP address. > >

RE: [PHP] I.P. range authentication

2003-03-18 Thread John W. Holmes
> $abytes = explode('.', $ip); // explode the IP string > $ip = 0; > foreach ($abytes as $byte) $ip = ($ip << 8) + $byte; > > This will give you the valid numeric equivalent of the IP address. Isn't that what ip2long() does? Also, the man page on ip2long() has some good notes and code th

Re: [PHP] I.P. range authentication

2003-03-18 Thread Ernest E Vogelsinger
At 23:04 18.03.2003, Will Bown said: [snip] >I am having trouble verifying if a user is within a specified I.P. range. >The idea is that if a user is at a library within an I.P. range like >231.55.*.* and their I.P. address is 231.55.122.226 a session would b