gaugeboson Posted March 1, 2008 Share Posted March 1, 2008 <?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); Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\viewentry.php on line 26 Link to comment https://forums.phpfreaks.com/topic/93888-unexpected-t_variable/ Share on other sites More sharing options...
QuietWhistler Posted March 1, 2008 Share Posted March 1, 2008 <?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); you forgot the dot( . ) Link to comment https://forums.phpfreaks.com/topic/93888-unexpected-t_variable/#findComment-481059 Share on other sites More sharing options...
gaugeboson Posted March 1, 2008 Author Share Posted March 1, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/93888-unexpected-t_variable/#findComment-481063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.