prophit
11-24-2006, 07:28 PM
Trying to get this to validate the ip address. But for some reason the first and last octet doesnt work right. You can enter more then 3 numbers and it will work. The middle octets work perfectly. Not sure why?
if(!ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})", $_POST["ipaddr"]))
if(!ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})", $_POST["ipaddr"]))