Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax error, unexpected T_VARIABLE in

    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 {

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    You need a period(concatenation operator) after this line:
    name, comment) VALUES("

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •