-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-blog.php
21 lines (18 loc) · 890 Bytes
/
upload-blog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
if(isset($_POST['add-blog'])){
include_once 'connection.php';
$author = mysqli_escape_string($conn,$_POST['author']);
$date = mysqli_escape_string($conn,$_POST['publishing-date']);
$category = mysqli_escape_string($conn,$_POST['category']);
$title = mysqli_escape_string($conn,$_POST['title']);
$meta_title = mysqli_escape_string($conn,$_POST['meta-title']);
$meta_desc = mysqli_escape_string($conn,$_POST['meta-desc']);
$meta_tags = mysqli_escape_string($conn,$_POST['meta-tags']);
$blog_content = mysqli_escape_string($conn,$_POST['blog-content']);
$query = "insert into blogs values('$author','$date','$category','$title','$meta_title','$meta_desc','$meta_tags','$blog_content')";
mysqli_query($conn,$query);
mysqli_close($conn);
$message = '<div class="alert alert-success">Blog Published Sucessfully !</div>';
header('Location: index.php' );
}
?>