-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.php
More file actions
55 lines (36 loc) · 1.36 KB
/
content.php
File metadata and controls
55 lines (36 loc) · 1.36 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
49
50
51
52
53
54
55
<head>
<script src="http://cdn.ckeditor.com/4.6.2/standard-all/ckeditor.js"></script>
</head>
<?php
if (isset($_POST['submit'])) {
$name=$_POST['page_name'];
$content=$_POST['content'];
$query="UPDATE pages SET page_content='$content' WHERE page_name='$name'";
dbQuery($query);
}
?>
<h1 style="color: #34ad00;margin-left: 10%"><?php echo $_GET['head']; ?>:</h1>
<div class="main_box extra wow zoomIn animated animated" data-wow-delay="1s"
style="animation-delay: 1s;animation-name: zoomIn;box-shadow: none;">
<?php
$head=strtolower(str_replace(" ","",$_GET['head']));
$query="SELECT page_content FROM pages WHERE page_name='$head'";
$result = dbQuery($query);
$data = dbFetchArray($result);
if ($_SESSION['user_type'] == "admin") {
?>
<form method='post' action=''>
<input type="hidden" name="page_name" value=<?=strtolower(str_replace(" ","",$_GET['head'])); ?>>
<textarea name="content" id="editor1" cols="20" rows="10"><?php echo $data['page_content']; ?></textarea>
<br/>
<div align="center"><input type="submit" name="submit" value=" Change " style="color: white;background: #34ad00"></div>
</form>
<?php
}else {
echo $data['page_content'];
}
?>
<script>
CKEDITOR.replace( 'editor1');
</script>
</div>