<?php
session_start();
include ("dbcfg/config.php");
//echo "steamid ".$_SESSION['steamid'];
//echo "<br>".session_id();
$ip = $_GET["ip"];
$sql = mysql_connect($dbhost, $dbuname, $dbpass)or die("Databasen svarar inte");
mysql_select_db($dbname, $sql);
//$a = mysql_query("SELECT count(*) FROM $table1 WHERE ip='".$ip."' AND authid!='".$_SESSION['steamid']."'", $sql);
//$an = mysql_result($a,0);

$sqlquery = mysql_query("SELECT nick,authid FROM $table1 WHERE ip='".$ip."' AND authid!='".$_SESSION['steamid']."'", $sql);
$an = mysql_num_rows($sqlquery);
?>
	<table width="100%" border="0" cellspacing="0" cellpadding="2">
  	<tr>
    <td  align="center" bgcolor="#F0F0F0">
	<table width="80%" border="0" cellpadding="2" cellspacing="1" id="info">
	<tr>
    <td width="50%" bgcolor="#DDDDDD"><b>Other players on the same ip</b></td>
	<td bgcolor="#DDDDDD"><a href=<?php echo $siteurl ?>playerinfo.php?authid=<?php echo $_SESSION['steamid'] ?>>Back</a></td>       
    </tr>

<?php 
if($an == 0)
{
?>
	<tr>
    <td width="50%" bgcolor="#E8E8E8"><b>There is no other players on that ip</b></td>
	<td bgcolor="#E8E8E8"><a href=<?php echo $siteurl ?>playerinfo.php?authid=<?php echo $_SESSION['steamid'] ?>>Back</a></td>       
    </tr>
<?php
}
else
{
	for($i = 0; $i < $an; $i++)
	{
		$info = mysql_fetch_array($sqlquery);  
?>	
    	<tr>
    	<td bgcolor="#E8E8E8"><a href=<?php echo $siteurl ?>playerinfo.php?authid=<?php echo $info['authid'] ?> > <?php echo $info['nick'] ?></a></td>
    	<td bgcolor="#E8E8E8"><?php echo $info['authid'] ?></td>       
    	</tr>
<?php	
	}
} 
?>
   			</table>
			</td>
  			</tr>
			</table>	
<?php
			mysql_close($sql);
?>


