-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_top10.php
More file actions
35 lines (33 loc) · 1.01 KB
/
xml_top10.php
File metadata and controls
35 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
header("Content-type: text/xml");
$steamid = "";
if (isset($_GET['Steamid'])) {
$steamid = mysql_real_escape_string($_GET["Steamid"]);
}
include("inc/dbconnect.php");
mysql_query("SET CHARACTER SET 'utf8'");
$sql = 'SELECT * FROM `Player` ORDER BY `POINTS` DESC LIMIT 0, 10 ';
$ergebnis = mysql_query($sql);
$i = 1;
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> \r\n";
echo "<players> \r\n";
while ($adr = mysql_fetch_array($ergebnis)) {
$NAME = $adr['NAME'];
$POINTS = $adr['POINTS'];
$STEAMID = $adr['STEAMID'];
$SUICIDES = $adr['SUICIDES'];
$DEATHS = $adr['DEATHS'];
$KILLS = $adr['KILLS'];
echo "<player> \r\n";
echo "<rank>" . $i . "</rank>";
echo "<name>" . $NAME . "</name>";
echo "<points>" . $POINTS . "</points>";
echo "<steamid>" . $STEAMID . "</steamid>";
echo "<suicides>" . $SUICIDES . "</suicides>";
echo "<deaths>" . $DEATHS . "</deaths>";
echo "<kills>" . $KILLS . "</kills>";
echo "</player> \r\n";
$i = $i + 1;
}
echo "</players> \r\n";
?>