Advertisement
Guest User

Untitled

a guest
May 30th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2. $ip='';//IP/SERVER INSTANCE HERE(ie: FAIL\SQLEXPRESS)
  3. $user='';//DATABASE USER(usually sa)
  4. $pass='';//DATABASE PASSWORD
  5.         if(!isset($_POST['submit'])){
  6.         ?>
  7.         <form action='' method="POST">
  8.             Character:<input type='text' name='user'>
  9.             <input type='submit' name='submit'></form>
  10.         <?php
  11.     }
  12.     else{
  13.         $link=mssql_connect($ip ,$user,$pass);
  14.         $nub=array(';', "'", '"', '#', '--');
  15.         $char=str_replace($nub, '', $_POST['user']);
  16.         $getacc=mssql_query("SELECT account FROM [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where m_szName='".$char."'");
  17.         if(mssql_num_rows($getacc) != 1){
  18.             die('Character does not exist');
  19.         }
  20.         $acc=mssql_fetch_row($getacc);
  21.         $result=mssql_query("SELECT remoteIP FROM [LOGGING_01_DBF].[dbo].[LOG_LOGIN_TBL] where account='".$acc[0]."'");
  22.         echo 'All RemoteIP Records for '.$char.'['.$acc[0].']<BR>';
  23.         echo '<table border="1">';
  24.         $i=1;
  25.         $last=array();
  26.         while ($row = mssql_fetch_assoc($result)){
  27.             if(!in_array($row['remoteIP'],$last)){
  28.                 echo '<tr><td>'.$i.'</td>';
  29.                 echo '<td>'.$row['remoteIP'].'</td></tr>';
  30.                 $i++;
  31.                 $last[]=$row['remoteIP'];
  32.             }
  33.         }
  34.     }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement