error, Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$'

Discussion in 'PHP' started by lagron, Sep 19, 2010.

  1. #1
    This thing has been bugging me for 2 hours now... : ( If anyone knows where I messed up writing this, it would be greatly appreciated.
    I added......to symbolize there is more after or before the given code...
    ....... //time difference; gets for how much the mysql server time is ahead, compared to the http server time;
     $query="SELECT timediff(now(), '".date("Y-m-d H:i:s")."')";
     $result=mysql_query($query, $db_id);
     $tdif=mysql_fetch_row($result); $tdif=explode(":", $tdif[0]);
     if ($tdif[0][0]=="-") {$tdif[0]=abs($tdif[0]); $tdif[3]="-";}
     else $tdif[3]="+"; $tdif=" ".$tdif[3]." interval ".$tdif[0]." hour ".$tdif[3]." interval ".$tdif[1]." minute ".$tdif[3]." interval ".$tdif[2]." second";
    
     if (isset($_SESSION["user"][0])) {$faction=faction($_SESSION["user"][10]); $imgs=$_SESSION["user"][13]; $fimgs=$faction[2];}
     else {$imgs="default/"; $fimgs="1/";}
    
    function msg($msg)
    {
     header("Location: msg.php?msg=".$msg);
    }
    
    function msg_trade($msg)
    {
     header("Location: msg2.php?msg=".$msg);
    }
    
    function msg_welcome($msg)
    {
     header("Location: welcome.php?msg=".$msg);
    }
    
    function usr_banned($msg)
    {
     header("Location: usr_banned.php?msg=".$msg);
    }
    
    function label($msg).....
    PHP:

     
    lagron, Sep 19, 2010 IP
  2. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #2
    Didn't PHP mention the number of the line containing the error?
     
    nabil_kadimi, Sep 19, 2010 IP
  3. QuandBen

    QuandBen Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Wrapping the first else statement into curly brackets will most probably fix it.
     
    QuandBen, Sep 19, 2010 IP
  4. WWSD

    WWSD Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Whats the actual line number?
     
    WWSD, Sep 19, 2010 IP
  5. sunlcik

    sunlcik Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your code let me down...
    check carefully,come on...
     
    sunlcik, Sep 19, 2010 IP