解析错误:语法错误,意外'。' (我疯狂地试图找到哪个点)

时间:2011-03-08 09:41:33

标签: php

以下代码中似乎有一个额外的点(或者可能缺少一个点):

$html = '<h1>Edit - '. $Qpost->post_title .'<h1><form name="edit_q" id="edit_q" method="POST" action="">
    <input type="text" class="question-title-box" value="' . $Qpost->post_title; . '" id="question-title-box" name="title" onfocus="if(this.value == \'' . __("Enter Question Title",'qna-forum') . '\'){this.value = \'\';}" onblur="if(this.value == \'\'){this.value = \'' . __("Enter Question Title",'qna-forum') . '\';}" />
    <textarea class="question-box" cols="70" rows="20" id="question-box" name="question" onfocus="if(this.value == \'' . __("Enter Your Question Here",'qna-forum') . '\'){this.value = \'\';}" onblur="if(this.value == \'\'){this.value = \'' .__("Enter Your Question Here",'qna-forum') . '\';}">' . $Qpost->post_content . '</textarea>';
    $html  .= "<div class='question-form-bottom'>".__('Category','qna-forum').":<select name='category' id='category'>";

3 个答案:

答案 0 :(得分:2)

"' . $Qpost->post_title; . '"

第二行有一个额外的分号

答案 1 :(得分:1)

你的第二行

class="question-title-box" value="' . $Qpost->post_title; . '" id="question-title-box"

在工作时使用像Eclipse(或任何其他代码编辑器)这样的编辑器总是很好,因为它们突出显示了这些东西

答案 2 :(得分:0)

删除;这里

"' . $Qpost->post_title; . '" id

to =&gt;

"' . $Qpost->post_title . '" id