<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>编辑</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="../../lib/ueditor1_4_3-utf8-php/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../lib/ueditor1_4_3-utf8-php/ueditor.all.min.js"> </script>
</head>
<?php
session_start();
if(isset($_REQUEST['id'])){
$id = $_REQUEST['id'];
}
else{
echo "ID 木有定义!";
exit;
}
include(dirname(__FILE__)."/../../config/connect.php");
if(isset($_REQUEST['cmd']) and $_REQUEST['cmd'] == 'submit'){
$myContent = htm
lsp
ecialchars($_REQUEST['myContent']);
$row_num = $db->query("
UPDATE
mall_goods_list
SET
html_content = '$myContent'
WHERE
id = '$id'
");
if(!$row_num){
echo "保存失败!<br><br>";
}
else{
echo "保存成功!<br><br>";
}
echo '<a href="mall_edit_goods.php?id='.$id.'" target="_self">返回上一页</a>';
}
else{
$html_content = $db->get_var("SELECT html_content FROM mall_goods_list WHERE id = '$id'");
$html_content = htmlspecialchars_decode($html_content);
echo '
<body>
<form method="post" action="mall_edit_goods.php?cmd=submit&id='.$id.'">
<span style="color:#ff0000;"><TEXTAREA id=myContent name="myContent">'.$html_content.'</TEXTAREA></span>
<span style="color:#ff0000;">
<SCRIPT type=text/javascript>
var editor = new UE.ui.Editor();
UE.getEditor("myContent");
UE.getEditor("myContent").addListener("selectionChange?cmd=",function(){
var editorValue = UE.getEditor("myContent").getContent();
window.parent.getEditorValue(editorValue);
});
</SCRIPT>
</span>
<button type="submit" value="提交">提交</button>
</form>
</body>
';
}
?>