-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
85 lines (74 loc) · 1.77 KB
/
index.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!Doctype html>
<html>
<head>
<title>Maker Blog Admin</title>
<link rel="stylesheet" href="../css/style.css">
</head>
<body>
<center>
<h2>
<?php
require_once "config.php";
session_start();
if(!isset($_SESSION['admin_login']))
{
header("location:login.php");
}
$id = $_SESSION['admin_login'];
$select_stmt = $db->prepare("select * from admin where id=:id");
$select_stmt->execute(array(":id"=>$id));
$row = $select_stmt->fetch(PDO::FETCH_ASSOC);
if(isset($_SESSION['admin_login']))
{
?>
Welcome,
<?php
echo $row['username'];
}
?>
</h2>
<a href="logout.php">Logout</a>
</center>
<h2>General Settings</h2>
<?php include "data.php";
if(isset($updateMsg))
{
?>
<div style="color:green">
<strong><?php echo $updateMsg; ?></strong>
</div>
<?php
}
?>
<form action="" method="post">
<input type="text" name="blogname" placeholder="Blog name" required/><br>
<input type="text" name="blogtitle" placeholder="Blog title" required/><br>
<input type="text" name="email" placeholder="Your email" required/><br>
<button type="submit" name="update">Save</button>
</form>
<h2>Upload a post</h2>
<?php include "post.php";
if(isset($msg))
{
?>
<div style="color:green">
<strong><?php echo $msg; ?></strong>
</div>
<?php
}
if(!isset($msg))
{
?>
<div style="color:red">
<strong><?php echo $msg; ?></strong>
</div>
<?php
}
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="text" name="title" placeholder="Post title" required/><br>
<input type="text" name="phrase" placeholder="Short information" required/><br>
<input type="file" name="image" required/><br>
<textarea name="content" placeholder="Post Content" required></textarea><br>
<button type="submit" name="post">post</button>
</form>