Ik zou graag weten wat er mis was met mijn script.. hij geeft een fout aan, waarvan ik niet weet wat het precies is.. ik hoop dat jullie ff kunnen helpen.. het script ziet er als volgt uit:
<CENTER>
<TABLE width=450>
ENDHTML;
if($user['mission'] == 1){
print <<<ENDHTML
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #1</th>
<tr><td>Mission:</td><td>Running man</td></tr>
<tr><td>Story:</td><td>Your brother wants to do a big organized crime, but he is unable to find a good car. Steal a car for him and he will pay you very good.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$150,000</b> and <b>1000</b> bullets.</td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Check Mission" name="check"></td></tr>
</table>
</form>
ENDHTML;
} elseif($user['mission'] == 2){
print <<<ENDHTML
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #2</th>
<tr><td>Mission:</td><td>ThaLegend's Realname</td></tr>
<tr><td>Story:</td><td>ThaLegend forgot his real name, now you have to help him out to find out.</td></tr>
<tr><td>Task:</td><td>Help ThaLegend by filling in his real name over here.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$100,000</b> and <b>1500</b> bullets.</td></tr>
<tr><td><input type="text" name="realname" maxlength"16"></td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Complete Mission" name="doit"></td></tr>
</table>
</form>
ENDHTML;
} else {
print <<<ENDHTML
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #3</th>
<tr><td>Mission:</td><td>Running man</td></tr>
<tr><td>Story:</td><td>test</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$test</b> and <b>test</b> bullets.</td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Check Mission" name="check"></td></tr>
</table>
</form>
ENDHTML;
}
/* ------------------------- */ ?>
<?PHP
if(isset($_POST['check'])){
$query = "SELECT * FROM `garage` WHERE `owner` = '".$user['username']."' AND `original` = 'Netherlands' AND `country` = 'Italy'";
$query = mysql_query($query);
$car = mysql_fetch_object($query);
if($car->value < 25000){
echo "The value of the car is too low.";
}
else{
$nmoney = $user['money'] + 150000;
$nmission = 2;
$nbullets = $user['bullets'] + 1000;
$nexperience = $user['experience'] + 500;
$query = "UPDATE `users` SET `bullets` = '".$nbullets."', `money` = '".$nmoney."', `mission` = '".$nmission."', `experience` = '".$nexperience."' WHERE `id` = '".$user['id']."'";
mysql_query($query) or die(mysql_error());
$msg = "You succesfully completed the <b>Running Man</b> mission. You got <b>$150,000</b> and <b>1000</b> bullets.";
$query = "INSERT INTO `messages` (`from`,`to`,`date`,`message`,`read`,`saved`) VALUES ('Notification','".$user['username']."','".date("d/m/Y H:i:s")."','".$msg."','0','0')";
mysql_query($query) or die(mysql_error());
$query = "DELETE FROM `garage` WHERE `id` = '".$car->id."'";
mysql_query($query) or die(mysql_error());
echo "You completed the mission.";
}
}
?>
<?PHP
elseif (isset($_POST['doit'])){
/* Verander hieronder de naam van de admin(bij admin) */
if ($_POST['realname'] == "Jan"){
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'";
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'";
echo "You completed the mission.";
exit;
} else {
echo "Wrong answer. Keep trying!";
}
}
?>
<tr><td>Story:</td><td>Your brother wants to do a big organized crime, but he is unable to find a good car. Steal a car for him and he will pay you very good.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$150,000</b> and <b>1000</b> bullets.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$test</b> and <b>test</b> bullets.</td></tr>
1. ga eens tutorials lezen voordat je het hele forum onder spamt
2. zet code tussen [code] tags
3. misschien makkelijk als je verteld welke fout
4. geen idee komt nog wel...
<?
...
//r75
echo "You completed the mission.";
}
}
} // je sloot je {} 1 keer te weinig
?>
<?PHP
elseif (isset($_POST['doit'])){
/* Verander hieronder de naam van de admin(bij admin) */
...
?>
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'";
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'";
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'";
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'";
Hier ben je vergeten de rondehaakjes ( ) << deze dus ) af te sluiten.
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'") or die (mysql_error());
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'") or die(mysql_error());
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'") or die(mysql_error());
Goedenmiddag mensen, ik heb een script gemaakt: missies.. alleen nu werkt hij nog niet correct, en wil ik jullie vragen om mij te helpen hiermee.. alvast bedankt.. het script ziet er als volgt uit:
<CENTER>
<TABLE width=450>
<?PHP
if($user['mission'] == 1){
if(isset($_POST['check'])){
$query = "SELECT * FROM `garage` WHERE `owner` = '".$user['username']."' AND `original` = 'Netherlands' AND `country` = 'Italy'";
$query = mysql_query($query);
$car = mysql_fetch_object($query);
if($car->value < 25000){
echo "The value of the car is too low.";
}
else{
$nmoney = $user['money'] + 150000;
$nmission = 2;
$nbullets = $user['bullets'] + 1000;
$nexperience = $user['experience'] + 500;
$query = "UPDATE `users` SET `bullets` = '".$nbullets."', `money` = '".$nmoney."', `mission` = '".$nmission."', `experience` = '".$nexperience."' WHERE `id` = '".$user['id']."'";
mysql_query($query) or die(mysql_error());
$msg = "You succesfully completed the <b>Running Man</b> mission. You got <b>$150,000</b> and <b>1000</b> bullets.";
$query = "INSERT INTO `messages` (`from`,`to`,`date`,`message`,`read`,`saved`) VALUES ('Notification','".$user['username']."','".date("d/m/Y H:i:s")."','".$msg."','0','0')";
mysql_query($query) or die(mysql_error());
$query = "DELETE FROM `garage` WHERE `id` = '".$car->id."'";
mysql_query($query) or die(mysql_error());
echo "You completed the mission."; }
?>
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #1</th>
<tr><td>Mission:</td><td>Running man</td></tr>
<tr><td>Story:</td><td>Your brother wants to do a big organized crime, but he is unable to find a good car. Steal a car for him and he will pay you very good.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$150,000</b> and <b>1000</b> bullets.</td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Check Mission" name="check"></td></tr>
</table>
</form>
<?PHP
} elseif($user['mission'] == 2){
}elseif (isset($_POST['doit'])){
/* Verander hieronder de naam van de admin(bij admin) */
if ($_POST['realname'] == "Achmed"){
mysql_query("UPDATE `users` SET `money`=`money`+'100000' WHERE `id` = '".$user['id']."'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bullets`=`bullets`+'1500' WHERE `id` = '".$user['id']."'") or die (mysql_error());
echo "You completed the mission.";
exit;
} else {
echo "Wrong answer. Keep trying!";
}
}
?>
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #2</th>
<tr><td>Mission:</td><td>ThaLegend's Realname</td></tr>
<tr><td>Story:</td><td>ThaLegend forgot his real name, now you have to help him out to find out.</td></tr>
<tr><td>Task:</td><td>Help ThaLegend by filling in his real name over here.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$100,000</b> and <b>1500</b> bullets.</td></tr>
<tr><td><input type="text" name="realname" maxlength"16"></td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Complete Mission" name="doit"></td></tr>
</table>
</form>
<?PHP
} else {
?>
<form action="<?=$_SERVER['PHP_SELF']; ?>?item=mission" method="POST">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan="2">Mission #3</th>
<tr><td>Mission:</td><td>Running man</td></tr>
<tr><td>Story:</td><td>test</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$test</b> and <b>test</b> bullets.</td></tr>
<tr><td colspan=2 align=center><input type="submit" class="submit" value="Check Mission" name="check"></td></tr>
</table>
</form>
</TABLE>
</body>
</html>
<tr><td>Story:</td><td>Your brother wants to do a big organized crime, but he is unable to find a good car. Steal a car for him and he will pay you very good.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$150,000</b> and <b>1000</b> bullets.</td></tr>
<tr><td>Task:</td><td>You need to steal car FROM <b>Netherlands</b> with a value of $25,000 and ship it to <b>Italy</b>. When you are there, click the 'Check mission' button.</td></tr>
<tr><td>Time limit:</td><td>No limit</td></tr>
<tr><td>Reward:</td><td><b>$test</b> and <b>test</b> bullets.</td></tr>