IP Lookup Script

Results 1 to 13 of 13
  1. #1
    Banned VLxPain is offline
    BannedRank
    May 2010 Join Date
    121Posts

    IP Lookup Script

    I was bored lately and made this ip lookup script in php.
    It looks up by character name, and does not show duplicates.
    I think I could have done a lot more things differently and that this script could be much more organized and optimized.
    PHP Code:
    <?php
        $ip
    ='';//IP/SERVER INSTANCE HERE(ie: FAIL\SQLEXPRESS)
        
    $user='';//DATABASE USER(usually sa)
        
    $pass='';//DATABASE PASSWORD
        
    if(!isset($_POST['submit'])){
        
    ?>
        <form action='' method="POST">
            Character:<input type='text' name='user'>
            <input type='submit' name='submit'></form>
        <?php
        
    }
        else{
            
    $link=mssql_connect($ip ,$user,$pass);
            
    $nub=array(';'"'"'"''#''--');
            
    $char=str_replace($nub''$_POST['user']);
            
    $getacc=mssql_query("SELECT account FROM [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where m_szName='".$char."'");
            if(
    mssql_num_rows($getacc) != 1){
                die(
    'Character does not exist');
            }
            
    $acc=mssql_fetch_row($getacc);
            
    $result=mssql_query("SELECT remoteIP FROM [LOGGING_01_DBF].[dbo].[LOG_LOGIN_TBL] where account='".$acc[0]."'");
            echo 
    'All RemoteIP Records for '.$char.'['.$acc[0].']<BR>';
            echo 
    '<table border="1">'
            
    $i=1;
            
    $last=array();
            while (
    $row mssql_fetch_assoc($result)){
                if(!
    in_array($row['remoteIP'],$last)){
                    echo 
    '<tr><td>'.$i.'</td>';
                    echo 
    '<td>'.$row['remoteIP'].'</td></tr>';
                    
    $i++;
                    
    $last[]=$row['remoteIP'];
                }
            } 
        } 
    ?>


  2. #2
    Proficient Member .hackz is offline
    MemberRank
    Sep 2008 Join Date
    New YorkLocation
    163Posts

    Re: IP Lookup Script

    Pretty good for creating it in like 10 minutes.

  3. #3
    Banned aldieri is offline
    BannedRank
    Oct 2008 Join Date
    ArizonaLocation
    250Posts

    Re: IP Lookup Script

    Sheesh pain you sux0r!

    I mean.... uhm

    naice work sir.

  4. #4
    Apocalypse bryle000 is offline
    MemberRank
    Oct 2008 Join Date
    221Posts

    Re: IP Lookup Script

    kewl, ip from the accounts where user is online or not :)

    thanks mate!

    cheers!

  5. #5
    Cyclops-Network Owner Alexsh is offline
    MemberRank
    Sep 2009 Join Date
    New YorkLocation
    306Posts

    Re: IP Lookup Script

    Wont work for people using antihacks such as ErlyGuard.

  6. #6
    Banned VLxPain is offline
    BannedRank
    May 2010 Join Date
    121Posts

    Re: IP Lookup Script

    yes it wouldn't but did I say it would? Tom, and ErlyGuard should be logging those ip addresses themselves. You can always use the %whois command in erly, forgot tom's :)

  7. #7
    Dragona wishly is offline
    MemberRank
    Aug 2008 Join Date
    PhilippinesLocation
    296Posts

    Re: IP Lookup Script

    because the ip that send to database logging_01_dbf is 127.0.0.1 using antihack.


    but very nice work pre.

    ---------- Post added at 04:40 AM ---------- Previous post was at 04:38 AM ----------

    in toms commands to see the players ip are %get_ip <character name>

  8. #8
    Cyclops-Network Owner Alexsh is offline
    MemberRank
    Sep 2009 Join Date
    New YorkLocation
    306Posts

    Re: IP Lookup Script

    Quote Originally Posted by VLxPain View Post
    yes it wouldn't but did I say it would? Tom, and ErlyGuard should be logging those ip addresses themselves. You can always use the %whois command in erly, forgot tom's :)
    You didn't say it wouldn't either /ridicule just thought i'd inform anyone that isn't aware of that fact.

  9. #9
    Account Upgraded | Title Enabled! Denichu is offline
    MemberRank
    Mar 2009 Join Date
    744Posts

    Re: IP Lookup Script

    lol at wishly, %get_ip : Invalid command

  10. #10
    PENTAKILL Scratch is offline
    MemberRank
    Oct 2008 Join Date
    LiverpoolLocation
    3,172Posts

    Re: IP Lookup Script

    Good work Pain ;D

  11. #11
    0xC0FFEE spikensbror is offline
    MemberRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: IP Lookup Script

    It's ok.
    I hate how messy and clogged the code is though.

  12. #12
    Banned VLxPain is offline
    BannedRank
    May 2010 Join Date
    121Posts

    Re: IP Lookup Script

    Didn't I say that it could have been better? :) It is messy and uses a little more resources then it should, but it's okay :)

  13. #13
    Account Upgraded | Title Enabled! Denichu is offline
    MemberRank
    Mar 2009 Join Date
    744Posts

    Re: IP Lookup Script

    Pain, no matter what, ur scripts are always funny D:



Advertisement