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'];
}
}
}
?>





