Nieuw lid |
|
Parse error: syntax error, unexpected $end in /home/lim/domains/lims.logd.nl/public_html/lims/koken.php on line 65
die foutmelding krijg ik ,, hier is mijn script
<?
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
if(! check_login()) {
header("Location: login.php");
exit;
}
if ($jisin == 1) { header("Location: jisin.php"); }
?>
<html>
<head>
<title>Lims</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width="100%" align=center>
<tr>
<td class="subTitle"><b>McDonalds</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt">
<?php
if(isset($_GET['pizza']) && $_GET['pizza'] == 1) {
$sQuery = "SELECT kaas, tomaten, salami FROM users WHERE user_id = " . $user_id; //$user_id zal wel in je site bekend zijn onder een variabele
$rResult = mysql_query($sQuery);
if(mysql_num_rows($rResult) == 0) {
echo 'Query mislukt of geen user id bekend';
} else {
while($r = mysql_fetch_array($rResult)) {
$aantal_kaas = $r['kaas'];
$aantal_tomaat = $r['tomaten'];
$aantal_salami = $r['salami'];
$kost_kaas = 2; //Hoeveel kaas kost 1 pizza
$kost_tomaat = 1; //Hoeveel kaas kost 1 pizza
$kost_salami = 2; //Hoeveel kaas kost 1 pizza
$fout = '';
if($aantal_kaas < $kost_kaas) {
$fout .= 'U heeft te weinig kaas';
}
if($aantal_tomaten < $kost_tomaten) {
$fout .= 'U heeft te weinig tomaten';
}
if($aantal_salami < $kost_salami) {
$fout .= 'U heeft te weinig salami';
}
if(isset($fout) && (strlen($fout) > 1)) {
echo $fout;
} else {
mysql_query("UPDATE `users` SET `pizza`=`pizza`+1 WHERE `login` = '{$data->login}'") or die (mysql_error());
}
}
?>
</td>
</tr>
</table>
</body>
</html>
<? include("config.php"); $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'"); if(! check_login()) { header("Location: login.php"); } if ($jisin == 1) { header("Location: jisin.php"); } ?> <html> <head> <title>Lims</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <table width="100%" align=center> <tr> <td class="subTitle"><b>McDonalds</b></td> </tr> <tr><td> </td></tr> <tr> <td class="mainTxt"> <?php if(isset($_GET['pizza']) && $_GET['pizza'] == 1) { $sQuery = "SELECT kaas, tomaten, salami FROM users WHERE user_id = " . $user_id; //$user_id zal wel in je site bekend zijn onder een variabele echo 'Query mislukt of geen user id bekend'; } else { $aantal_kaas = $r['kaas']; $aantal_tomaat = $r['tomaten']; $aantal_salami = $r['salami']; $kost_kaas = 2; //Hoeveel kaas kost 1 pizza $kost_tomaat = 1; //Hoeveel kaas kost 1 pizza $kost_salami = 2; //Hoeveel kaas kost 1 pizza $fout = ''; if($aantal_kaas < $kost_kaas) { $fout .= 'U heeft te weinig kaas'; } if($aantal_tomaten < $kost_tomaten) { $fout .= 'U heeft te weinig tomaten'; } if($aantal_salami < $kost_salami) { $fout .= 'U heeft te weinig salami'; } } else { } } ?> </td> </tr> </table> </body> </html>
|