Jump to content

messy, wrong output.


grlayouts

Recommended Posts

Ok, i have my own online PHP game.

 

I have a multi account check that checks the ip of the player against other players But it outputs really random.

 

I was wondering if anyone could tidy it up.

 

<?
$title = "Multi Log";
include("header.php");

$get_mm = mysql_query("SELECT ip FROM players where jail='0' GROUP BY ip HAVING COUNT(ip) >1");
while($row=mysql_fetch_array($get_mm)){
$ip=$row[ip];
$get_mn = mysql_query("SELECT * FROM players WHERE ip='$ip'");
$row2=mysql_fetch_array($get_mn);
if(!empty($row2)) $doubleips[] = $row2[user];
if(!empty($row2)) $doubleips2[] = $row2[id];
}
?>
<?php
if ($stat[user] != Admin) {
print "sorry you cannot use this function.";
include("footer.php");
exit;
}
?>
<? print_r($doubleips); ?>
<br><br>
<? print_r($doubleips2); ?>
<br><br>
<? print "<form method=post action=multi.php?view=ban&step=banned> ID: <input type=text name=id><br>
Reason: <input type=text name=br><br>

<input type=submit value=Ban></form>";
if ($step == banned) {
mysql_query("update players set jail=21 where id=$id");
mysql_query("update players set level='0.0' where id=$id");
mysql_query("update players set zone1='BANNED' where id=$id");
mysql_query("update players set jailreason='$br' where id=$id");
print "Account banned";
include("footer.php");
exit;
}
?>
<?
include("footer.php");
?>

 

its output looks like.

 

Array ( [0] => LiLPLaT [1] => rustystar1105 [2] => Sparda [3] => eagles5 [4] => bradleynutty [5] => Zoner [6] => Admin [7] => flossyfarjo [8] => paws )

Array ( [0] => 257 [1] => 270 [2] => 178 [3] => 347 [4] => 125 [5] => 74 [6] => 1 [7] => 171 [8] => 343 ) 

Link to comment
https://forums.phpfreaks.com/topic/42250-messy-wrong-output/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.