Reverse IP tool

Discussion in 'PHP' started by oxidati0n, Dec 29, 2008.

  1. #1
    It took me ages finding this, but all in all.. once I did I felt so embarassed. lol.

    It's a reverse IP tool, I made it.

    
    
    error_reporting(0); //stop errors
    $dns = "www.youtube.com";
    
    if($supplier = gethostbyname( $dns ))
    {
    echo $supplier;
    }
    error_reporting(1); //resume errors back to normal.
    Code (markup):
    Insert that in your code, you'd need to justify the www.youtube.com area with either $_GET, $_POST or ajax.
     
    oxidati0n, Dec 29, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    It's not a reverse IP tool, it's a IP lookup tool - very different.

    But congratulations anyway, btw your error stopping is... interesting. At the very least use something like this.
    $error_level = error_reporting(0); //stop errors
    $dns = "www.youtube.com";
    
    if($supplier = gethostbyname( $dns ))
    {
        echo $supplier;
    }
    error_reporting($error_level); //resume errors back to normal.
    PHP:
     
    Danltn, Dec 29, 2008 IP
  3. oxidati0n

    oxidati0n Peon

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh yeah, because I was going to add some more coding for the reverse IP bit. It was too long, so I just lost interest in posting it.

    Error reporting works either way, so your $error_level variable doesn't have any bonus effect.

    I used error reporting because if the hostname is invalid it outputs an error, so you won't really be able to report "invalid ip" because the error will fill your page up for you instead.
     
    oxidati0n, Dec 29, 2008 IP
  4. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Actually, the default error level is very rarely 1.

    Normally E_ALL ^ E_NOTICE. Which actually evals to 6135 on PHP 5.2.x - not quite 1 - the $error_level will take in the original value and remember it for when you reset.

    Read about them here: http://php.net/error_reporting

    And also for a single line you can use error supression like so:
    if($supplier = @gethostbyname( $dns ))
    PHP:
    This means you won't have to mess around with error_reporting levels.
     
    Danltn, Dec 29, 2008 IP