...

View Full Version : syntax error, unexpected T_VARIABLE in



goldenbough
02-17-2008, 06:24 AM
Parse error: syntax error, unexpected T_VARIABLE on line 26

<?php

require("config.php");

if(isset($_GET['id']) == TRUE) {
if(is_numeric($_GET['id']) == FALSE) {
$error = 1;
}
if($error == 1) {
header("Location: " . $config_basedir);
}
else {
$validentry = $_GET['id'];
}
}
else {
$validentry = 0;
}

if($_POST['submit']) {
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);

$sql = "INSERT INTO comments(blog_id, dateposted,
name, comment) VALUES("
$validentry .", NOW(),'" . $_POST['name']
. "', '" . $_POST['comment'] . "');";
mysql_query($sql);
header("Location: http://" . $HTTP_HOST
. $SCRIPT_NAME . "?id=" . $validentry);
}
else {

Inigoesdr
02-17-2008, 06:28 AM
You need a period(concatenation operator) after this line:
name, comment) VALUES("

goldenbough
02-17-2008, 06:35 AM
Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum