奇怪的情況,我不明白爲什麼我的PHP腳本不通過HTML代碼。無法傳遞HTML數據通過PHP
好吧,我正在我的網站上工作,並根據免費和高級配置文件類型來顯示WYISIWYG文本編輯器。我使用簡單的「a」,「b」和「c」來表示我的mysql數據庫中的免費和溢價。
但是,當我試圖製作腳本並運行時,它僅顯示「b」和「c」帳戶類型的數據,但沒有顯示「a」類型的數據。
這是我的代碼。
<?php
include_once("../scripts/userlog.php"); (it is where i assign id to users)
$id = "$log_id";
$sql_type = mysql_query("SELECT acc_type FROM members WHERE id='$id' LIMIT 1");
while($row = mysql_fetch_array($sql_type)){
$acc = $row["acc_type"];
if($acc = "a"){
$field = '<div id="wysiwyg_cp" style="padding:8px; width:700px;">
<input type="button" onClick="iBold()" value="B">
<input type="button" onClick="iUnderline()" value="U">
<input type="button" onClick="iItalic()" value="I">
<input type="button" onClick="iFontSize()" value="Text Size">
<input type="button" onClick="iForeColor()" value="Text Color">
<input type="button" onClick="iHorizontalRule()" value="HR">
<input type="button" onClick="iUnorderedList()" value="UL">
<input type="button" onClick="iOrderedList()" value="OL">
<input type="button" onClick="iLink()" value="Link">
<input type="button" onClick="iUnLink()" value="UnLink">
<input type="button" onClick="iImage()" value="Image">
</div>
<!-- Hide(but keep)your normal textarea and place in the iFrame replacement for it -->
<textarea style="display:none;" name="content" id="content" cols="100" rows="14"> </textarea>
<iframe name="richTextField" id="richTextField" style="border:#000000 1px solid; width:700px; height:300px;"></iframe>
<!-- End replacing your normal textarea -->';
}
if($acc = "b"){
$field = 'adding soon';
}
if($acc = "c"){
$field = 'adding soon';
}
}
?>
當我運行該腳本,我只得到 「立即補充」
怎麼能你代表三種不同設置的賬戶類型? – ceejayoz
** == **是比較** = **是分配 – 2013-10-14 19:54:57