PHP beginner |
|
<?php
is_numeric($_POST['score']) or die("score is not numeric");
mysql_connect("localhost","licht","zegIkNiet") or die("MySQL ".mysql_ errno().": ".mysql_error());
mysql_select_db("licht") or die("MySQL ".mysql_ errno().": ".mysql_error());
mysql_query("INSERT INTO log VALUES ('".$_SERVER["REMOTE_ADDR"]."',CURRENT_TIMESTAMP,'".$_SERVER["HTTP_USER_AGENT"]."','".$_POST['score']."');") or die("MySQL ".mysql_ errno().": ".mysql_error());
echo mysql_affected_rows() or die("MySQL ".mysql_ errno().": ".mysql_error());
?>
<?php mysql_query("INSERT INTO log VALUES ('".$_SERVER["REMOTE_ADDR"]."',CURRENT_TIMESTAMP,'".$_SERVER["HTTP_USER_AGENT"]."','".$_POST['score']."');") or die("MySQL ".mysql_ errno ().": ".mysql_error()); ?>
Citaat: Parse error: syntax error, unexpected T_STRING in /home/peter/licht/log.php on line 3 Ik lees er waarschijnlijk gewoon overheen, maar iemand van jullie ziet het vast wel
|