Results 1 to 10 of 15

Thread: IP range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Private
    Join Date
    Jun 2013
    Posts
    70
    Thanks
    20
    Thanked 32 Times in 26 Posts
    hi
    u can split the ips with strtok and then compare it like this

    PHP Code:
    IsOk(testIp,ranges,index)
    {
        
    strtok(ranges,".");
        
    strtok(testIp,".");
        if(!
    isdefined(t[index-1])) return false;
        if(
    int(t[index-1]) > int(r[index-1]))  return false;
        return 
    true;
    }

    iprangeissmaller IsOk("123.123.123.10","123.123.123.150",4); 

  2. The Following User Says Thank You to vanfreddy For This Useful Post:

    Ni3ls (8th October 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •