<?php
$alogin = "mssql_login";
$apass = "mssql_psw";
$host = "127.0.0.1";
$db="MuOnline"; //have another?
//Lines above you can add to config.php and then add there:
//require 'config.php';
if (!empty($_GET['char'])){
$name = $_GET['char'];
$msconnect=mssql_connect("$host","$alogin","$apass");
$msdb=mssql_select_db("$db",$msconnect);
$result = mssql_query("select accountid from character where name LIKE '%$name%'");
$row = mssql_fetch_row($result);
$result = mssql_query("select IP from memb_stat where memb___id = '$row[0]'");
$roww = mssql_fetch_row($result);
echo '
<table height=30 cellspacing=0 cellpadding=8 width=250 border=1 bgcolor="#000000" bordercolor="#000000" align="center">
<tbody>';
echo "
<tr>
<td valign=top align=center colspan=5><strong><font color=Blue>Searched Character: $name</td>
</tr>
<tr>
<td valign=top align=center colspan=5><strong><font color=red>Account ID: $row[0]</td>
</tr>
<tr>
<td valign=top align=center colspan=5><strong><font color=red>IP: $roww[0]</td>
</tr>
<tr>
<td valign=top align=center colspan=5><strong><font color=yellow>Accounts with same ip:</td>
</tr>
<td valign=top align=center><strong><font color=yellow>Account ID</td>
<td valign=top align=center><strong><font color=red>Characters</td>
<td valign=top align=center><strong><font color=yellow>Status</td>
<td valign=top align=center><strong><font color=red>Has Blocked<br>Characters?</td>
<td valign=top align=center><strong><font color=blue>Is Account<br>Blocked?</td>
</tr>";
$result = mssql_query("select memb___id, ConnectStat from memb_stat where ip = '$roww[0]'");
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$result2 = mssql_query("Select bloc_code from memb_info where memb___id = '$row[0]'");
$row2 = mssql_fetch_row($result2);
$result3 = mssql_query("Select GameID1, GameID2, GameID3, GameID4, GameID5 from AccountCharacter where Id = '$row[0]'");
$row3 = mssql_fetch_row($result3);
$result4 = mssql_query("Select accountid from character where accountid = '$row[0]' and CtlCode = '1'");
$row4 = mssql_fetch_row($result4);
$blocked = '<font color=green>No</font>';
$chars= '<font color=green>No</font>';
$status = '<font color=red>OffLine</font>';
if ($row2[0] == 1){
$blocked = '<font color=red>Yes</font>';
}
if ($row4[0] == $row[0]){
$chars = '<font color=red>Yes</font>';
}
if ($row[1] == 1){
$status = '<font color=green>OnLine</font>';
}
echo "<tr>
<td valign=top align=center><strong><font color=yellow>$row[0]</td>
<td valign=top align=center><strong><font color=blue>$row3[0] $row3[1] $row3[2] $row3[3] $row3[4]</td>
<td valign=top align=center><strong><font color=red>$status</td>
<td valign=top align=center><strong><font color=yellow>$chars</td>
<td valign=top align=center><strong><font color=red>$blocked</td>
</tr>";
}
} else {
echo '<strong><font color=red>Link should look like: http://127.0.0.1/script_file.php?char=MyNick</strong>';
}
?>