解析错误意外$ end

时间:2012-01-09 06:45:10

标签: php

这是什么意思?我的页面一直工作正常,直到我评论出一些代码后突然出现。这是我正在使用的代码。它不会让我发布这个,因为没有足够的描述所以我只是填补一些空间。

Parse error: syntax error, unexpected $end in C:\xampp\htdocs\test4\mainpage.php on line 387

<?php 
if($note['type'] == 'list')
{
    $note_type='list';      

    print "<table>";
    while($note_info = mysql_fetch_array( $note_content ))
{
    print "<tr><td>";
    if($note_info['complete'])
       echo "<strike>";
        echo $note_info['body'];
        print "</td>";

    if($note_info['complete']){
        echo "</strike>";           
        echo "<td><input type='checkbox' name='complete_goal' value='".$note_info['note_id']."'></input></td>";
    }   
     print "</tr>";
}


/*  
    print "<dl style=\"float:left\">";  
    while($note_info = mysql_fetch_array( $note_content ))
    {
        if($note_info['complete'])
           echo "<strike>";
    echo "<dt>".$note_info['body']."</dt>";
        if($note_info['complete'])
            echo "</strike>";
    }
    print "</dl>";

    mysql_data_seek($note_content, 0);
    print "<dl style=\"float:right\">"; 
    while($note_info = mysql_fetch_array( $note_content ))
    {
//      if(!$note['complete'])
        echo "<dt><input type='checkbox' name='complete_goal' value='".$note_info['note_id']."'></input></dt>";
    }
    print "</dl>";
}
else
{
    echo $note['body'];
}
*/
?>

2 个答案:

答案 0 :(得分:0)

在评论您的代码时,您还评论了最顶层}条件的右括号if($note['type'] == 'list')

答案 1 :(得分:0)

试试这个:

if($note['type'] == 'list')
{
    $note_type='list';      

    echo "<table>";

    while($note_info = mysql_fetch_array( $note_content ))
    {
        print "<tr><td>";

        if($note_info['complete'])
        {
           echo "<strike>";
           echo $note_info['body'];
           echo "</td>";
        }

        if($note_info['complete'])
        {
           echo "</strike>";           
           echo "<td><input type='checkbox' name='complete_goal' value='".$note_info['note_id']."'></input></td>";
        }   

        echo "</tr>";
    }

    echo "</table>";
}

您还应该使用可以为您检测这些错误的IDE。给Netbeans一个机会。