rendered paste body <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Player Search</title>
</head>
<body background="images/bg1.jpg" style="font-family: Arial" link="#FF0000" text="#FFFFFF" bgcolor="#EEA24D">
<h2>Battlefield Players.com - Player Search</h2>
</HEAD>
<table border=1 width="100%" align=center bordercolorlight=#D87B14 bordercolordark=#FF9900 cellpadding=0>
<TR><TD>
<form name="search" method="post" action="<?=$PHP_SELF?>">
Seach for: <input type="text" name="searchstring" /> in
<Select NAME="field">
<Option VALUE="hash">CD-hash</option>
<Option VALUE="alias">alias</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>
</TD>
<TD>
<?php
$db = mysql_connect('localhost', 'bfplayers', '66948940') or die(mysql_error());
mysql_select_db('bfplayers', $db);
// General Statistics
$resultguids = mysql_query("SELECT * FROM guids");
$num_rows_guids = mysql_num_rows($resultguids);
$resultaliases = mysql_query("SELECT * FROM aliases");
$num_rows_aliases = mysql_num_rows($resultaliases);
$resultservers = mysql_query("SELECT * FROM servers");
$num_rows_servers = mysql_num_rows($resultservers);
echo "<B><P ALIGN=RIGHT>Logging ALL players since 7th June 2007<BR></B>";
echo "<B><font color=red>", $num_rows_guids , "</font> Unique players tracked.</B><BR>";
echo "<B><font color=red>", $num_rows_aliases , "</font> Aliases tracked.</B><BR>";
echo "<B><font color=red>", $num_rows_servers , "</font> Servers monitored.</B><BR>";
echo "<B>And counting...<BR>";
// END General Statistics
?>
</TD>
</TR>
</TABLE>
<?php
$hash = $_GET['searchstring'];
//echo "<BR>" .$hash;
if ($_REQUEST['searchstring'] == "")
{
echo "<p>You haven't entered a search term yet";
exit;
}
//if ($_REQUEST['field'] !="")
if ($_REQUEST['field'] == 'guid')
{
echo "You searched for:<b> " .$searchstring , "</B> in the <B>" .$field ," database</B>";
echo "<P></B>";
echo "<h2>Results</h2><p>";
echo "<P>";
Print "<table border=1 align=center bordercolorlight=#D87B14 bordercolordark=#FF9900 cellpadding=3>";
Print "<tr>";
Print "<th>Alias:</th>";
Print "<th>CD Hash:</th>";
Print "<th>First Seen:</th>";
Print "<th>Last Seen:</th></tr>";
{
echo $row['val'] . '<br>';
}
$res = mysql_query("
SELECT DISTINCT a.alias_string, g.guid_string,
MIN(s.time_first) AS time_first,
MAX(IF(s.time_last IS NULL, sv.last_update, s.time_last)) AS time_last
FROM aliases AS a, guids AS g, sessions AS s, servers AS sv
WHERE s.alias_key=a.alias_key
AND s.guid_key=g.guid_key
AND s.server_key=sv.server_key
AND g.guid_string LIKE '%${_REQUEST['searchstring']}%'
GROUP BY alias_string
ORDER BY alias_string ASC", $db) or die(mysql_error());
while ($row = mysql_fetch_assoc($res))
{
//print_r($row);
Print "<tr>";
echo "<th><a href=player1.php?field=alias&searchstring=".urlencode($row['alias_string']). ">".$row['alias_string']."</a></th>";
echo "<th><a href=player1.php?field=hash&searchstring=".$row['guid_string']. ">".$row['guid_string']."</a></th>";
Print "<th>${row['time_first']}</th>";
Print "<th>${row['time_last']}</th></tr>";
}
Print "</table>";
$anymatches=mysql_num_rows($res);
if ($anymatches == 0)
{
echo "Sorry, but we can not find a CD-hash to match your search criteria<br><br>";
}
else
echo "<P>Total number of matching records: <B> " .$anymatches , "</B>";
}
elseif ($_REQUEST['field'] == 'alias')
{
echo "You searched for:<b> " .$searchstring , "</B> in the <B>" .$field ," database</B>";
echo "<P></B>";
echo "<h2>Results</h2><p>";
echo "<P>";
Print "<table border=1 align=center bordercolorlight=#D87B14 bordercolordark=#FF9900 cellpadding=3>";
Print "<tr>";
Print "<th>Alias:</th>";
Print "<th>CD Hash:</th>";
Print "<th>First Seen:</th>";
Print "<th>Last Seen:</th></tr>";
{
echo $row['val'] . '<br>';
}
$res = mysql_query("
SELECT DISTINCT a.alias_string, g.guid_string,
MIN(s.time_first) AS time_first,
MAX(IF(s.time_last IS NULL, sv.last_update, s.time_last)) AS time_last
FROM aliases AS a, guids AS g, sessions AS s, servers AS sv
WHERE s.alias_key=a.alias_key
AND s.guid_key=g.guid_key
AND s.server_key=sv.server_key
AND a.alias_string LIKE '%${_REQUEST['searchstring']}%'
GROUP BY alias_string
ORDER BY alias_string ASC", $db) or die(mysql_error());
while ($row = mysql_fetch_assoc($res))
{
//print_r($row);
Print "<tr>";
echo "<th><a href=player1.php?field=alias&searchstring=".urlencode($row['alias_string']). ">".$row['alias_string']."</a></th>";
echo "<th><a href=player1.php?field=hash&searchstring=".$row['guid_string']. ">".$row['guid_string']."</a></th>";
Print "<th>${row['time_first']}</th>";
Print "<th>${row['time_last']}</th></tr>";
}
Print "</table>";
$anymatches=mysql_num_rows($res);
if ($anymatches == 0)
{
echo "Sorry, but we can not find a CD-hash to match your search criteria<br><br>";
}
else
echo "<P>Total number of matching records: <B> " .$anymatches , "</B>";
}
mysql_close($db);
?>
</body>
</html>