
May 27th, 2000, 04:01 AM
|
|
Junior Member
|
|
Join Date: May 2000
Location: Oslo, Norway
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I use:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
if (ereg("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}",$ip)) {
print "The IP is valid.";
}
else {
print("The IP is not valid.");
}
[/code]
If you want to check everything you could make sure its not part of the 10.* A class or the 192.168.* B class since those are reserved for private networks.
N.
|