Lid |
|
hey
<?php
if(mysql_connect('localhost','root',''))
{
mysql_select_db('**') or die(mysql_error());
}
else
{
echo 'Kan geen verbinding maken';
exit;
}
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST))
{
$aFouten = array();
if($_POST['your_nick'] == '')
{
$aFouten[] = 'You didnt fill in your own ingame or irc nick';
}
if($_POST['target'] == '')
{
$aFouten[] = 'You didnt fill in a target';
}
if($_POST['bullets'] == '' || !is_numeric($_POST['bullets']))
{
$aFouten[] = 'You didnt fill in a possible amound of bullets --> only numbers allowed (not 60k --> 60000)';
}
if(count($aFouten) != 0)
{
echo 'There are some faults: <br /><br />';
for($Fi = 0; $Fi < count($aFouten); $Fi++)
{
echo $aFouten[$Fi].'<br />';
}
echo '<br />Click <a href="javascript:history.go(-1);">here</a> to go back';
}
else
{
$sNick = addslashes($_POST['your_nick']);
$sTarget = addslashes($_POST['target']);
$sBullets = addslashes($_POST['bullets']);
mysql_query("UPDATE Iets SET
killer='".$sNick."', bullets='".$sBullets."', niveau='4', WHERE target = ".$sTarget." ") or die(mysql_error());
echo 'Youve confirmed your kill. Thanks and respect for shooting!';
}
}
else
{
?>
<form action=" <?=$_SERVER['PHP_SELF']?> " method="POST">
Your ingame/irc nick: <input type="text" name="your_nick"><br />
Target: <input type="text" name="target"><br />
Bullets: <input type="text" name="bullets"><br />
<input type="submit" name="verzenden" value="Confirm kill">
</form>
<?
}
?>
<?php { } else { echo 'Kan geen verbinding maken'; } if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) { if($_POST['your_nick'] == '') { $aFouten[] = 'You didnt fill in your own ingame or irc nick'; } if($_POST['target'] == '') { $aFouten[] = 'You didnt fill in a target'; } if($_POST['bullets'] == '' || !is_numeric($_POST['bullets'])) { $aFouten[] = 'You didnt fill in a possible amound of bullets --> only numbers allowed (not 60k --> 60000)'; } { echo 'There are some faults: <br /><br />'; for($Fi = 0; $Fi < count($aFouten); $Fi++) { echo $aFouten[$Fi].'<br />'; } echo '<br />Click <a href="javascript:history.go(-1);">here</a> to go back'; } else { killer='".$sNick."', bullets='".$sBullets."', niveau='4', WHERE target = ".$sTarget." ") or die(mysql_error()); echo 'Youve confirmed your kill. Thanks and respect for shooting!'; } } else { ?> <form action=" <?=$_SERVER['PHP_SELF']?> " method="POST"> Your ingame/irc nick: <input type="text" name="your_nick"><br /> Target: <input type="text" name="target"><br /> Bullets: <input type="text" name="bullets"><br /> <input type="submit" name="verzenden" value="Confirm kill"> </form> <? } ?>
hoort het allemaal te doen, maar krijg dit:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE target = Tafel' at line 2
iemand die weet hoe dat goed moet..?
|