Someone can give a usefull help here?

Discussion in 'PHP' started by deny, Dec 18, 2007.

  1. #1
    I have found some script that give output of all domains listed on same class ip. For example if you input 208.76.80.74 output will be:

    This is code.

    
    <?
    $ipaddress=getenv("remote_addr");
    
    if ($Submit=="Find all hosts on this domain")
    {
    
           echo "Your Input was : <b><font color=red face=arial>$input</font></b><br>";  
                 
           $ipadd=gethostbyname ($input);
    
    
           list($ip1,$ip2,$ip3,$ip4)=explode('.',$ipadd);
    
           for ($a=0;$a<256;$a++)
           {
                 $scanip="$ip1.$ip2.$ip3.$a";
                 $newhostname=gethostbyaddr($scanip);  
                 echo "$scanip ---> <a href=\"http://$newhostname\">$newhostname</a><br>";
           }
    
    }
    
    
    ?>
    
    Code (markup):
    It looks to me similar but can not figure out to get all domains on same ip address as can be seen here:
    reverseiplookup.net

    Any idea? Help? Way of modified script above?

    Thanks
     
    deny, Dec 18, 2007 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    try to replace $scanip="$ip1.$ip2.$ip3.$a"; -> $scanip="$ip1.$ip2.$ip3.$ip4";
     
    kmap, Dec 19, 2007 IP
  3. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #3
    hahaha
    kmap how for loop will work if he will not use $a variable
     
    sunnyverma1984, Dec 19, 2007 IP
  4. Tanzil Ahmed

    Tanzil Ahmed Well-Known Member

    Messages:
    357
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #4
    sunny is right its looping
     
    Tanzil Ahmed, Dec 19, 2007 IP