指引网

当前位置: 主页 > 网页制作 > WEB开发 >

新浪编辑器使用方法

来源:网络 作者:佚名 点击: 时间:2017-07-19 00:35
[摘要] header('content-type:text/html;charset=utf-8;'); include_once('sinaeditor.class.php教程'); /*********************************************************************************/ //这里判断表单提交动作,然后赋值给$content; if($_get['a

 

header('content-type:text/html;charset=utf-8;');
include_once('sinaeditor.class.php教程');
/*********************************************************************************/
//这里判断表单提交动作,然后赋值给$content;
if($_get['act']=='subok') die(htmlspecialchars($content=$_post['gently_editor']));
/*********************************************************************************/
$editor=new sinaeditor('gently_editor');
$editor->value='<img src="../logo.gif"><h2>新浪博客编辑器php图片上传版!</h2>';
$editor->basepath='.';
$editor->height=500;
$editor->width=650;
$editor->autosave=false;
?>
<div align="center">
<form name="form1" id="form1" method="post" action="index.php?act=subok">
<?php
 $editor->create();
?><br />
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</div>

<?
class sinaeditor{
 var $basepath;
 var $width;
 var $height;
 var $ename;
 var $value;
 var $autosave;
 function sinaeditor($ename){
  $this->ename=$ename;
  $this->basepath='.';
  $this->autosave=false;
  $this->height=460;
  $this->width=630;
 }
 function __construct($ename){
  $this->sinaeditor($ename);
 }
 function create(){
  $readcookie=$this->autosave?1:0;
  print <<<eot
  <textarea name="{$this->ename}" id="{$this->ename}" style="display:none;">{$this->value}</textarea>
  <iframe src="{$this->basepath}/edit/editor.htm?id={$this->ename}&readcookie={$readcookie}" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="{$this->width}" height="{$this->height}"></iframe>
eot;
 }
}
?>

编辑器下载地址
http://down.111cn.net/webedit/2010/0819/20307.html

------分隔线----------------------------