PHP expert |
|
heb een scripte dat admin de gelegenheid geeft om warnings uit te delen, maar als ik op yes druk dat updat hij ook keurig, maar wil ik nog een keer een warning uitdelen dan update hij niet meer
hier het belangrijkste gedeelte
$warnings = mysql_query("SELECT * FROM users WHERE id = '".$_GET[id]."'") or die(mysql_error());
$warnings = mysql_fetch_array($warnings) or die(mysql_error());
?>
<form method="post" action="">
<tr>
<td>Are you sure you want to give the user <i><?=$warnings['username']?></i> a warning?</td>
</tr>
<tr>
<td><input type="submit" name="yes" value="Yes"></td>
</tr>
</form>
<?php
if(isset($_POST['yes'])) {
$id = $_GET['id'];
echo "<tr><td colspan='2'>".$warnings['username']."'s warning level has increased by 1</td></tr>";
$warning = $query['warning'] +1;
$update = mysql_query("UPDATE users set warning = '".$warning."' WHERE id = '".$id."'") or die(mysql_error());
if($query['warning'] == "3") {
mysql_query("UPDATE users SET rank='0' WHERE id='".$id."'") or die(mysql_error());
echo "This user has been banned";
}
}
$warnings = mysql_query("SELECT * FROM users WHERE id = '".$_GET[id]."'") or die(mysql_error()); $warnings = mysql_fetch_array($warnings) or die(mysql_error()); ?> <form method="post" action=""> <tr> <td>Are you sure you want to give the user <i><?=$warnings['username']?></i> a warning?</td> </tr> <tr> <td><input type="submit" name="yes" value="Yes"></td> </tr> </form> <?php if(isset($_POST['yes'])) { $id = $_GET['id']; echo "<tr><td colspan='2'>".$warnings['username']."'s warning level has increased by 1</td></tr>"; $warning = $query['warning'] +1; if($query['warning'] == "3") { echo "This user has been banned"; } }
hoop dat iemand mij kan helpen
|