我的结果输出的是一串字条串,而不是HTML在浏览器输出的正常格式.
我的1.php为:
<?php
include("fckeditor/fckeditor.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<br>
<form name="docwrite" method="post" action="2.php" target="_blank">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="500"><tr>
<td width="70%">
<?php
$sBasePath = "/fckeditor/";
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->BasePath = $sBasePath ;
// $oFCKeditor->Value = 'This is some <strong>sample text</strong>' ;
$oFCKeditor->Height = '500' ;
$oFCKeditor->Width ='60%';
$oFCKeditor->Skin =office2003;
$oFCKeditor->Create() ;//oFCKeditor.BasePath = "/fckeditor/";
?>
<!--<textarea name="content" class="input" cols="100" rows="20"></textarea>  <font color="red">*</font>--></td>
</tr>
<tr>
<td align="center"><input class="button" type="submit" value="提交" /></td>
</tr>
</table>
</form>
</body>
</html>==================
提交的处理页面2.php为:
<?phpif ( isset( $_POST) )
$postArray = &$_POST ; // 4.1.0 or later, use $_POST
else
$postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARSforeach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
else
$postedValue = htmlspecialchars( $value ) ;}
echo $postedValue;
?>=====================
我的输出结果为:
<p>dfsafdasfadsf</p> <p><font size="5">gfdsgsdfgsdfg</font></p>
能人帮帮忙,很急,我是初学PHP,第一次用FCKeditor,谢谢!

解决方案 »

  1.   

    关注ing,我接触不久、、、、
      

  2.   

    把htmlspecialchars函数去掉,$postedValue=$value; 函数htmlspecialchars是将将特殊字符转成 HTML 格式,是一般的html标签能以字符串的形式显示在页面上,就像你最后输出的结果中能显示<p>而不是被解析了。你应该是把函数htmlspecialchars的功能理解反了,你可以试一下,而且你也可以看一下你输出结果页面的源代码,看看<p>是以什么形式输出的