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

Thread: unexpected T_IF

  1. #1
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts

    unexpected T_IF

    PHP Code:
    <?php
    while($msg mysql_fetch_array($chat)) {
        if(
    $msg['user_level'] == && $_SESSION['user_level'] == 4) {
        
        echo 
    "<tr>";
        echo 
    "<td align=\"left\" valign=\middle\" bgcolor=\"#343434\" width=\"600\">[".$msg['time']."]<span class=\"mod\">~MOD~</span><a href=\"javascript:poptastic('/controls/chat.php?msg_id=".$msg['msg_id']."');\" title='User ID: ".$msg['user_id']."'>" ucfirst($msg['username']) . "</a>: <span class=\"textmod\">" $msg['msg'] ."</span></td>";
        echo 
    "<tr>";
        }
        
        elseif(
    $msg['user_level'] == 3) {
        
        echo 
    "<tr>";
        echo 
    "<td align=\"left\" valign=\middle\" bgcolor=\"#343434\" width=\"600\">[".$msg['time']."]<span class=\"mod\">~MOD~</span>" ucfirst($msg['username']) . "</a>: <span class=\"textmod\">" $msg['msg'] ."</span></td>";
        echo 
    "<tr>";
        
        }
        
        
        if(
    $msg['user_level'] == 4) {
        
        echo 
    "<tr>";
        echo 
    "<td align=\"left\" valign=\middle\" bgcolor=\"#343434\" width=\"600\">[".$msg['time']."]<span class=\"gm\">~GM~</span>" ucfirst($msg['username']) . ": <span class=\"textgm\">" $msg['msg']. "</span></td>";
        echo 
    "<tr>";
        
        }
        elseif(
    $msg['user_level'] == && $_SESSION['user_level'] == 4) {
        
        echo 
    "<tr>";
        echo 
    "<td align=\"left\" valign=\middle\" bgcolor=\"#343434\" width=\"600\">[".$msg['time']."]<a href=\"javascript:poptastic('/controls/chat.php?msg_id=".$msg['msg_id']."');\" title='User ID: ".$msg['user_id']."'>".ucfirst($msg['username']).": </a>" $msg['msg'] . "</td>"
        echo 
    "<tr>";
        }
        elseif(
    $msg['user_level'] == 2) {
        
        echo 
    "<tr>";
        echo 
    "<td align=\"left\" valign=\middle\" bgcolor=\"#343434\" width=\"600\">[".$msg['time']."]" ucfirst($msg['username']) .": " $msg['msg'] . "</td>"
        echo 
    "<tr>";
        }
        
        
        }    
        
    ?>
    I keep on a getting a error saying: Parse error: syntax error, unexpected T_IF in /var/www/main.php on line 88

    I'm not seeing it. Do you guys see what is wrong with it?
    Last edited by Jon W; 03-21-2009 at 05:33 AM.

  • #2
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Nevermind.. lol Stupid error on my end.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What was the solution?
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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