Fckeditor在PHP应用中,如何循环出在编缉器中显示的不同内容
看代码:
这个可以正常显示,
<?php
while($row = $db->fetch_array($query)){
{
?>
<form action="?" method="post">
<textarea name="test_content[]" style="padding:3px; width:90%;"><?php echo($row['content']);?></textarea>
<input type="submit" value="确定" />
</form>
<?php
}
?>
改写为下面的代码:
<?php
while($row = $db->fetch_array($query)){
{
?>
<form action="?" method="post">
<?php
include("../fckeditor/fckeditor.php");
$oFCKeditor = new FCKeditor('test_content[]');
$oFCKeditor -> BasePath = "../fckeditor/";
$oFCKeditor -> Value = $row['content'];
$oFCKeditor -> Create();
?>
<input type="submit" value="确定" />
</form>
<?php
}
?>
输出的所有的内容都是相同的,也就是不循环,应该如何解决?
看代码:
这个可以正常显示,
<?php
while($row = $db->fetch_array($query)){
{
?>
<form action="?" method="post">
<textarea name="test_content[]" style="padding:3px; width:90%;"><?php echo($row['content']);?></textarea>
<input type="submit" value="确定" />
</form>
<?php
}
?>
改写为下面的代码:
<?php
while($row = $db->fetch_array($query)){
{
?>
<form action="?" method="post">
<?php
include("../fckeditor/fckeditor.php");
$oFCKeditor = new FCKeditor('test_content[]');
$oFCKeditor -> BasePath = "../fckeditor/";
$oFCKeditor -> Value = $row['content'];
$oFCKeditor -> Create();
?>
<input type="submit" value="确定" />
</form>
<?php
}
?>
输出的所有的内容都是相同的,也就是不循环,应该如何解决?
$oFCKeditor = new FCKeditor('test_content[]');
$oFCKeditor -> BasePath = "../fckeditor/";
把这段代码放到循环外面试试行么?
$i=0;
while($row = $db->fetch_array($query)){
{
?>
<form action="?" method="post">
<?php
include("../fckeditor/fckeditor.php");
$oFCKeditor[$i] = new FCKeditor('test_content[]');
$oFCKeditor[$i] -> BasePath = "../fckeditor/";
$oFCKeditor[$i] -> Value = $row['content'];
$oFCKeditor[$i] -> Create();
$i++;
?>
<input type="submit" value="确定" />
</form>
<?php
}
?>