D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
kavyaeventz.in
/
admin
/
Filename :
blog-form.php
back
Copy
<?php include('include/header.php'); if(isset($_POST['submit'])){ $blog_title =$_POST['blog_title']; $blog_desc =$_POST['blog_desc']; $blogger_name =$_POST['blogger_name']; $date = date('Y/m/d'); $meta_title =$_POST['meta_title']; $meta_desc =$_POST['meta_desc']; $meta_key =$_POST['meta_key']; $filename = $_FILES['image']['name']; $tmpname = $_FILES['image']['tmp_name']; $add = "images/products/".$filename; move_uploaded_file($tmpname,$add); $value= mysqli_query($conn,"INSERT INTO `blog`(`blog_title`, `blog_desc`,`image`, `blogger_name`, `date`,`meta_title`,`meta_desc`,`meta_key`) VALUES ('$blog_title','$blog_desc','$filename','$blogger_name','$date','$meta_title','$meta_desc','$meta_key' )"); if($value){ echo "<script> alert('Blog Added');window.location.href='blog.php'</script>"; } else{ echo "<script> alert('Please try again')</script>"; } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="d-flex align-items-center"> <div class="me-auto"> <h4 class="page-title">Add Blog</h4> </div> </div> </div> <!-- Main content --> <section class="content"> <div class="box"> <div class="box-header with-border"> <h4 class="box-title">Add New Blog</h4> </div> <!-- /.box-header --> <div class="box-body"> <form role="form" method="POST" enctype="multipart/form-data"> <!-- text input --> <div class="form-group"> <label class="form-label">Blogger Name</label> <input type="text" class="form-control" placeholder="Enter ..." name="blogger_name" required> </div> <div class="form-group"> <label class="form-label">Blog Title</label> <input type="text" class="form-control" placeholder="Enter ..." name="blog_title" required> </div> <div class="form-group"> <label class="form-label">Meta Title</label> <input type="text" class="form-control" placeholder="Meta Title" name="meta_title" required> </div> <div class="form-group"> <label class="form-label">Meta Description</label> <input type="text" class="form-control" placeholder="Meta Desc" name="meta_desc" required maxlength="180"> </div> <div class="form-group"> <label class="form-label">Meta Keywords</label> <input type="text" class="form-control" placeholder="Meta Keywords" name="meta_key" required> </div> <div class="form-group"> <label class="form-label">Blog Description</label> <textarea name="blog_desc" id="editor"></textarea> </div> <div class="form-group"> <label class="form-label">Image</label> <input type="file" class="form-control" accept="image/png, image/jpeg, image/jpg" name="image" onchange="ShowImage(event)" required> <img src="" width="200" id="image" /> </div> <div class="box-footer"> <button type="submit" class="btn btn-success" name="submit">Add</button> </div> </form> </div> <!-- /.box-body --> </div> </section> <!-- /.content --> </div> </div> <!-- /.content-wrapper --> <script src="//cdn.ckeditor.com/4.22.1/standard/ckeditor.js"></script> <script> CKEDITOR.replace( 'editor'); </script> <script> CKEDITOR.replace( 'editor2'); </script> <?php include('include/footer.php') ?>