Login   Register  
PHP Classes
elePHPant
Icontem

NetCheck() $networks parameter

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      XIP Class  >  All threads  >  NetCheck() $networks parameter  >  (Un) Subscribe thread alerts  
Subject:NetCheck() $networks parameter
Summary:how does the $networks parameter work and what does it mean?
Messages:2
Author:Schnaaf
Date:2006-03-11 18:39:44
Update:2006-03-12 09:58:00
 

  1. NetCheck() $networks parameter   Reply  
Picture of Schnaaf
Schnaaf
2006-03-11 18:39:44
The XIP class returns 192.168.253.23 as my ipaddress

I try to use NetCheck to check if I'm a user thats connected using an ip in the range of 192.168.253.0 untill 192.168.253.255. What should the $networks parameter of NetCheck() be?

  2. Re: NetCheck() $networks parameter   Reply  
Picture of Volkan Küçükçakar
Volkan Küçükçakar
2006-03-12 09:58:00 - In reply to message 1 from Schnaaf
Hi,

In general; $networks parameter must be written as IP/Mask format; there may be multiple entries separated with comma or new line.. (also can be array..) (very flexible :)

if you want to check ip is in the range of 192.168.253.0 to 192.168.253.255; mask must be 255.255.255.0

So, networks parameter should be 192.168.253.0/255.255.255.0
(BTW, it should be 192.168.253.0/24 if you prefer short snytax...)

example:

if ($XIP->NetCheck($ip,"192.168.253.0/255.255.255.0")) echo "YES IN RANGE !";