21,886
社区成员
发帖
与我相关
我的任务
分享
function weiyuanchuang(){
var myeditor = FCKeditorAPI.GetInstance('body');
var content = myeditor.EditorDocument.body.innerHTML;
//alert(content);
var url = "?";
content=encodeURI(content);
var postStr = "dopost=weiyuanc&content="+content;
xmlHttp = GetXmlHttpRequest();
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.onreadystatechange = replaceContent;
xmlHttp.send(postStr);
}
function replaceContent(){
if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
var response = xmlHttp.responseText;
var myeditor = FCKeditorAPI.GetInstance('body');
SetEditorContents("body",response);
}
}
if($dopost=='weiyuanc')
{
//echo $_REQUEST["content"]; die();
$sql = "select * from stream_weiyuanc";
$dsql->SetQuery($sql);
$dsql->Execute();
$content = stripslashes(iconv ("utf-8","GBK",urldecode($_POST["content"])));
$i=0;
$oriArray = array();
$replaceArray = array();
while($row = $dsql->GetArray()){
$oriArray[$i] = "/".$row['oriTitle']."/";
$replaceArray[$i] = $row['replaceTitle'];
$i++;
}
echo preg_replace($oriArray,$replaceArray,$content);
exit();
}
content=encodeURI(content);