Hallo CP
Ik heb even een probleempje,
ik krijg deze error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/jorisgast/domains/righelli.nl/public_html/bank.php on line 47
dit is mn script:
PHP
<?php
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`drankt`) AS `drankt`,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>Vendetta</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width=100%>
<tr><td class="subTitle"><b>Bank</b></td></tr>
<?php
if(isset($_POST['out']) && preg_match('/^[0-9]+$/',$_POST['amount'])) {
if($_POST['amount'] <= $data->bank) {
$data->zak += $_POST['amount'];
$data->bank -= $_POST['amount'];
mysql_query("UPDATE `users` SET `bank`={$data->bank},`zak`={$data->zak} WHERE `login`='{$data->login}'");
}
else
print " <tr><td class=\"mainTxt\">Zoveel geld staat er niet op de bank</td></tr>\n";
}
else if(isset($_POST['in']) && preg_match('/^[0-9]+$/',$_POST['amount'])) {
if($_POST['amount'] <= $data->zak) {
$data->zak -= $_POST['amount'];
$data->bank += $_POST['amount'];
$data->bankleft--;
mysql_query("UPDATE `users` SET `bank`={$data->bank},`zak`={$data->zak} WHERE `login`='{$data->login}'");
}
else
print " <tr><td class=\"mainTxt\">Zoveel geld heb je niet</td></tr>\n";
}
elseif ($_POST['donate'] && $_POST['waar'] == persoon) {
$query = mysql_query("SELECT * FROM `users` WHERE `login`='{$_POST['naar']}'");
$res = mysql_fetch_object($query);
$naar = strtolower($_POST['naar']);
$van = strtolower($data->login);
$_POST['obedrag']= str_replace(",","",$_POST['obedrag']);
if(!preg_match('/^[0-9]+$/',$_POST['obedrag'])){ echo ""Ongeldig bedrag.n"; }
elseif ($data->zak < $_POST['obedrag']) { print ""Zoveel geld heb je niet op zak.\n"; }
elseif ($_POST['obedrag'] <= 0) { print ""Fout.n"; }
elseif (!$res->login) { print ""Deze gebruiker bestaat niet.\n"; }
elseif ($res->status == dood) { print ""Deze gebruiker is dood.n"; }
elseif ($van == $naar) { print ""Je kan niet aan jezelf doneren.\n"; }
else {
mysql_query("INSERT INTO `logs`(`time`,`login`,`person`,`code`,`area`,`com`) values(NOW(),'{$data->login}','{$_POST['naar']}','{$_POST['obedrag']}','donate','{$_POST['com']}')");
mysql_query("UPDATE `users` SET `zak`=`zak`-{$_POST['obedrag']} WHERE `login`='{$data->login}'");
mysql_query("UPDATE `users` SET `zak`=`zak`+{$_POST['obedrag']} WHERE `login`='{$res->login}'");
print "<font color=\"red\">Overmaken gelukt.</font>";
}
}
print <<<ENDHTML
<tr><td class="mainTxt" align="center">
<table align="center">
<tr><td width=100>Contant:</td> <td align="right">€{$data->zak}</td></tr>
<tr><td width=100>Op de bank:</td> <td align="right">€{$data->bank}</td></tr>
</table>
<form method="post"><table align="center">
<tr><td align="center">€<input type="text" name="amount" maxlength="7">,-
<input type="submit" name="out" value="UIT" style="width: 100;">
<input type="submit" name="in" value="IN" style="width: 100;"></td></tr>
</table></form>
</td></tr>
<tr>
<td class="subTitle"><b>Overschrijven</b></td>
</tr>
<tr>
<td class="mainTxt">
<table align="center" width=100%>
<form method="post"><table align="center">
<tr><td align="right">Naar<input type="text" name="naar" maxlength="20"></td></tr>
<br><tr><td align="right">€<input type=text name="obedrag" value="" maxlength=9></td></tr>
<tr><td align="right">Beschrijving<input type=text name="com" value=""></td></tr>
<tr><td align="center"><input type=submit name=donate value=Ok></td></tr>
</table></form>
</td></tr>
</table></td></tr>
ENDHTML;
?>
</table></body></html>
Toon Meer
graag snelle reacties aangezien mn site al online is.
MVG(h)