I am trying to make a page where only admins can get. You can then check out the person profile and determine to verify them or not. The reason this is done manually is because its about a game, and if the enemies get in...Well I’m sure you can think. I have the admin page, only accessible by admins. I can output a verification table, but I cant update the database. Here is what my verification table looks like.
This is the following code that pertains to that.
PHP Code:
<?php
$not_verified = mysql_query("SELECT * FROM users WHERE status = '0'") or die(mysql_error());
print "<form name=\"verify\" method=\"post\" action=\"users.php\">
<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr bgcolor=\"#990000\">
<td width=\"100\"> <div align=\"center\"><font color=\"#CCCCCC\"><strong>Username</strong></font></div></td>
<td width=\"100\"> <div align=\"center\"><font color=\"#CCCCCC\"><strong>StrikeAction</strong></font></div></td>
<td width=\"100\"> <div align=\"center\"><font color=\"#CCCCCC\"><strong>Armysize</strong></font></div></td>
<td width=\"30\"> <div align=\"center\"><font color=\"#CCCCCC\"><strong>Verify</strong></font></div></td>
</tr>";
while($info = mysql_fetch_array($not_verified)){
$userun = $info['user'];
$userstatid = "http://www.kingsofchaos.com/stats.php?id=".$info['statid'];
$usersa = $info['strikeaction'];
$userarmysize = $info['armysize'];
print "<tr>
<td width=\"100\">
<div align=\"right\"><a href=\"$userstatid\" target=\"_blank\">$userun</a></div></td>
<td width=\"100\">
<div align=\"right\">$usersa</div></td>
<td width=\"100\">
<div align=\"right\">$userarmysize</div></td>
<td width=\"30\">
<div align=\"center\">
<input name=\"vusername['".$userun."']\" type=\"checkbox\" id=\"$userun\" value=\"1\">
</div>
</td>
</tr>";
}
print " <tr bgcolor=\"#990000\">
<td width=\"100\" height=\"25\"> </td>
<td width=\"100\" height=\"25\"> </td>
<td width=\"100\" height=\"25\"> </td>
<td width=\"40\" height=\"25\">
<div align=\"center\">
<input type=\"submit\" name=\"Submit\" value=\"Verify\" style=\"color:black; background-color:#CCCCCC; border-width:0px;\">
</div></td>
</tr>
</table></form>";
if($_POST){
foreach($_POST['vusername'] as $vusername => $value){
mysql_query("UPDATE `users` SET `status` = 1 WHERE user = '".$vusername."' LIMIT 1") or die(mysql_error());
echo $vusername;
}
}
?>
My problem is that it never updates the database where status is to 1 with the selected username in the verification table. Any help would be great full; I have tried to post on several other forums, but no help. I hope you can all help me.
|