我也使用FCKEditor,但是没有手册,55555555
解决方案 »
- 如何按button後才產生cookies?
- 多国语版本问题
- 知名出版社征ASP.NET和PHP高手写书
- 怎么用正则替换“href=a_test.php?id=45”为"45",其中45为可变数字,在线等,谢谢!
- 想学编程,大家帮我参考一下,学 PHP 还是 ASP.NET ?
- xml-parse-into-struct在解析XML时出错,在线等待
- 在线等~~ffmpeg的php代码究竟得如何写?
- FCKeditor圖片上傳的問題
- 免费国际域名申请!绝对不容错过! (www.yourname.com的顶级域名)
- php高手请进!关于session传变量的问题
- COOKIE的问题?
- 入门级问题--请高手指教
取转义的工作要由你自己进行当magic_quotes_gpc = 1 时
提交的数据可直接如库而不必做任何处理通常的做法是先根据magic_quotes_gpc状态做去转义处理,然后在入库时做转义处理
即
提交后
$contetn =$_POST['content'];
if (get_margic_quotes_gpc() != 0) {
$content = stripslashes($content);
}入库前
$content = addslashes($content);这样当向数据库插入非提交的数据时也不会出现问题又
既然你使用模板引擎,那么可把FCKEditor放在模板函数中
以smarttemplate为例,可以
smarttemplate_extension_editer.php
<?php
/**
* 功能函数
* 用于调用在线编辑器
* 引用格式 {editer:"编辑区变量名","宽度","高度","样式"}
* 样式可缺省,可以有Basic、Accessibility
**/
function smarttemplate_extension_editer($submit, $width, $height, $mode="") {
echo '<script src="fckeditor/tool.js"></script>';
$oFCKeditor = new FCKeditor ;
$oFCKeditor->ToolbarSet = $mode ;
if(! empty($GLOBALS[$submit]))
$oFCKeditor->Value = $GLOBALS[$submit] ;
else
$oFCKeditor->Value = $_POST[$submit] ;
$oFCKeditor->CreateFCKeditor( $submit, $width, $height ) ;
}
?>
模板中
<form method=post>
{editer:"content","100%","350"}
<input type=submit>
</form>