我已經使用CKEditor的類在我的PHP頁面中添加了一個textarea控件。
現在,如果textarea加載空,CKEditor的作品。但是,如果我嘗試在textarea中加載一個PHP變量,頁面將正確顯示編輯器,但它不會顯示內容(並且編輯器似乎被阻止)。 這裏是我的代碼:CKEditor不會加載php變量
<div id="dialog-edit" title="Edit" style="display: none;">
<table cellspacing="10">
<tr>
<td>
<table>
<form method="post" name="form">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<br/>
<textarea class="ckeditor" name="html" id="html" style="width: 766px; height: 390px; margin-left: 6px;"><?php echo htmlentities($html) ?></textarea><br/>
<input type="submit" name="save" id="save" value="Salva modifiche" class="button" />
</form>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function showDialogEdit()
{
$("#dialog-edit").dialog({
width: 680,
height: 620,
modal: true,
open: function(event, ui)
{
}
});
}
</script>
textarea的必須顯示內容(保存在MySQL數據庫作爲HTML代碼),到textarea的,但它沒有這樣做。
這是什麼問題?
謝謝。
您是否嘗試'回聲$ HTML;',而不是'$打印HTML;'?你確定'$ html'的價值嗎? – 2013-05-10 14:40:34
@ Siamak.A.M是的,它仍然沒有工作... – 2013-05-10 14:41:56
我很確定'$ html'的值是空的。你可以在其他地方迴應它,看看它是否爲空? – 2013-05-10 14:45:23