-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.php
More file actions
48 lines (41 loc) · 1.08 KB
/
Copy patheditor.php
File metadata and controls
48 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require './config.php';
require './common.php';
//获取编辑器内容
$htmlData = '';
if (!empty($_POST['content1'])) {
if (get_magic_quotes_gpc()) {
$htmlData = stripslashes($_POST['content1']);
} else
{
$htmlData = $_POST['content1'];
}
}
//获取哪个子菜单跳转过来的id
$smarty->assign('subid',$_GET['subid']);
if(!empty($_POST['subid']))
{
$content1 =mysql_real_escape_string($htmlData);
//插入
$time=time();
if($_POST['function']=="updateart")
{
$sql="update article_table set title ='".$_POST['title']."' where id =".$_POST['artid'];
$filename="templates/article/".$_POST['artid'].".tpl";
file_put_contents("aaaaaaaaaaaaa.txt",$sql);
}
else
{
$sql="insert into article_table(id, title, subid) VALUES (".$time.",'".$_POST['title']."',".$_POST['subid'].")";
$filename="templates/article/".$time.".tpl";
}
$s = new sqlhelper($G);
$s->execute_sql($sql);
file_put_contents($filename,$htmlData);
header("Location: admin.php");
exit;
}
$smarty->display('admin.tpl');
$smarty->display('editor.tpl');
@$smarty->assign('subid',$_POST['subid']);
?>