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 Quote Link to comment 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( . ) Quote Link to comment Share on other sites More sharing options...
gaugeboson Posted March 1, 2008 Author Share Posted March 1, 2008 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.