I need a way to add a range of IPaddress to a databases the
    example below work as long as the last numbers in the IPaddress
    are equal length like three numbers or two or one. If the first
    IPaddress has 1 number and the second has two or three numbers the
    script will not work.
    
    $ip1=230.234.234.4    This will work
    $ip2=230.234.234.9

    $ip1=230.234.234.4     This will not work
    $ip2=230.234.234.25

    $ip1=230.234.234.25    This will not work
    $ip2=230.234.234.126


    
         $ip1=trim($ip1);
         $ip2=trim($ip2);
        $ip = $ip1;
        while ($ip <= $ip2){ 
    $query = "insert into ipaddress(ip)values ('$ip')";
        $Result = safe_query($query);
        $ip++;
        }

  

-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to