-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
37 lines (33 loc) · 845 Bytes
/
admin.php
File metadata and controls
37 lines (33 loc) · 845 Bytes
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
<?php
$title = "For your eye's only";
include "includes/_header.php";
require_login();
db_connect();
?>
<p>Fill in the new blog form below.</p>
<?php
if(isset($_POST['submit'])){
$title = $_POST['Title'];
$content = $_POST['Content'];
$date = date('Y-m-d');
mysql_query("INSERT INTO blogData (Title, theDate, Content) VALUES('$title', '$date', '$content')");
header("location: blog.php");
}else{
?>
<form action='admin.php' method='POST'>
<table>
<tr>
<td><label for="Title">Title</label></td>
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td><label for="Content">Content</label></td>
<td><textarea name="Content"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Post!"></td>
</tr>
</table>
</form>
<?php }; ?>
<?php include "includes/_footer.php"; ?>