怎样获取FCKeditor中的值?

zhengbin_007 zhengbin_007 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我用的是FCKeditor2.23数据提交后...

用$content=$_POST['content'];//获取不到客户端输入的值...用过这个编辑器
的朋友告诉下啊...

fckeditor.php 代码如下:


class FCKeditor
{
var $InstanceName ;
var $BasePath ;
var $Width ;
var $Height ;
var $ToolbarSet ;
var $Value ;
var $Config ;

// PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
function __construct( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '200' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;

$this->Config = array() ;
}

// PHP 4 Contructor
function FCKeditor( $instanceName )
{
$this->__construct( $instanceName ) ;
}

function Create()
{
echo $this->CreateHtml() ;
}

function CreateHtml()
{
$HtmlValue = htmlspecialchars( $this->Value ) ;

$Html = '<div>' ;

if ( $this->IsCompatible() )
{
if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
$File = 'fckeditor.original.html' ;
else
$File = 'fckeditor.html' ;

$Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;

if ( $this->ToolbarSet != '' )
$Link .= "&Toolbar={$this->ToolbarSet}" ;

// Render the linked hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;

// Render the configurations hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;

// Render the editor IFRAME.
$Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
}
else
{
if ( strpos( $this->Width, '%' ) === false )
$WidthCSS = $this->Width . 'px' ;
else
$WidthCSS = $this->Width ;

if ( strpos( $this->Height, '%' ) === false )
$HeightCSS = $this->Height . 'px' ;
else
$HeightCSS = $this->Height ;

$Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
}

$Html .= '</div>' ;

return $Html ;
}

function IsCompatible()
{
global $HTTP_USER_AGENT ;

if ( isset( $HTTP_USER_AGENT ) )
$sAgent = $HTTP_USER_AGENT ;
else
$sAgent = $_SERVER['HTTP_USER_AGENT'] ;

if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
{
$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
return ($iVersion >= 5.5) ;
}
else if ( strpos($sAgent, 'Gecko/') !== false )
{
$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
return ($iVersion >= 20030210) ;
}
else
return false ;
}

function GetConfigFieldString()
{
$sParams = '' ;
$bFirst = true ;

foreach ( $this->Config as $sKey => $sValue )
{
if ( $bFirst == false )
$sParams .= '&' ;
else
$bFirst = false ;

if ( $sValue === true )
$sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
else if ( $sValue === false )
$sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
else
$sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
}

return $sParams ;
}

function EncodeConfig( $valueToEncode )
{
$chars = array(
'&' => '%26',
'=' => '%3D',
'"' => '%22' ) ;

return strtr( $valueToEncode, $chars ) ;
}
}
$oFCKeditor = new FCKeditor('content') ;//实例化
$oFCKeditor->BasePath = 'fckeditor/';//这个路径一定要和上面那个引入路径一致,否则会报错:找不到fckeditor.html页面
//$oFCKeditor->Value = '' ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '350' ;
$oFCKeditor->Create() ;

--------------------
index.html //内容添加页面
<form method="post" action="upload.php" enctype="multipart/form-data">
<td>
<textarea name="content" style="display:none">
</textarea>
<iframe width="100%" id=content height="350" src="./templates/admin/fckeditor.php?id=content&style=standard" >

</iframe>
</td>

---------------
upload.php


$content=$_POST['content'];//没有值...

要把值用xml来保存...那么内容包括图片数据,这些数据能正常保存吗.怎么保存

...全文

相关推荐

YKSpec-Swift资源

IOS bug vx: yykyyk123456 :1130484708

froginwe11

STMCubeMX使用TB6612驱动编码轮并进行测速

TB6612电机驱动模块通过IN1和IN2引脚控制电机的旋转方向,并通过PWM信号的占空比调节电机速度。代码示例展示了如何使用GPIO控制电机的正反转,以及如何动态调整PWM占空比实现速度控制。系统设计中,TB6612与编码减速电机连接,STM32CubeMX用于初始化GPIO和PWM输出。编码器接口配置使用TIM3进行测速,TIM4定时器用于速度计算。Keil软件中编写的代码包括编码轮计数值获取、速度计算、电机正反转控制以及小车运动控制等功能。通过OLED显示速度,并实现电机的调试与测试。

爱学习的小旭

STM32N6实战:FSBL引导XIP运行ThreadX与NetX Duo

在嵌入式系统开发中,程序的存储与执行方式直接影响启动速度和系统实时性。传统MCU常将代码拷贝到内存运行,而高主频处理器则可通过XIP(片外Flash原地执行)技术直接从外部存储取指,省去拷贝过程。但XIP的前提是外部存储器控制器需在上电后第一时间完成初始化,这正是FSBL(第一级引导程序)的核心职责。FSBL负责配置时钟与外部Flash,并将控制权移交给应用。而要让设备具备实时调度与网络能力,可搭配ThreadX实时内核和NetX Duo双协议栈,两者在CubeMX中原生集成,形成一套高性能MCU+外部存储

凯萨薇

6.2 磁悬浮轴承:软件架构与实现

本文系统阐述了磁悬浮轴承控制系统的软件架构与实现方法。采用分层架构设计,包括硬件抽象层、实时控制内核、控制算法层和应用层,确保系统实时性和可靠性。重点分析了电流环、位置环等关键控制任务的调度策略,比较了不同硬件平台(DSP、ARM、FPGA)的软件实现方案。强调模块化设计、配置化管理等工程实践,并详细介绍了从算法仿真到系统联调的完整开发流程。最后指出严格的测试验证是保证系统性能的关键,需通过多阶段测试评估起浮时间、稳态精度等核心指标。

FanXing_zl

WOFOST模型参数调优实战:从‘跑不通’到‘预测准’的避坑指南

本文详细介绍了WOFOST模型参数调优的实战技巧,帮助用户从模型报错诊断到参数敏感性分析,再到土壤-作物参数联调策略,逐步解决‘跑不通’到‘预测准’的问题。通过Python和PCSE工具,提供参数扰动测试模板和关键参数优先级矩阵,助力作物模型的高效校准与预测。

福桃九分饱
评论 9
收藏 已收藏
分享
返回顶部
zhengbin_007
基础编程 21,889 成员 140,329 内容