Create Simple CMS Content Management System Using PHP, PDO ,MySQL



Simple Blogger Type Cms Using PHP, PDO
 
Create your Own Simple and Basic Content management System CMS using PHP, Mysql etc. In this step by step guide you will learn How to build a CMS.

Before getting started I recommend you to read below.

I always searched How to make a CMS like Blogger, BlogSpot Clone in Php,Mysql etc back then. When I was learning php I always wanted to learn to build a CMS like Google Blogger in php but couldn't find a 100% accurate guide or course or any piece of information on that .
 
 

So let's get started

View-Demo is not working due to some technical reason it will work soon so try again later.
 
View Demo | Download Full Codes

Note: Username is aizaz.dinho and Password is test, demo might be slow because its free hosting


Our Folder Structure 

Simple Blogger Type Cms Using PHP, PDO
Folder Structure



First Make Database Name it "cms" and inside cms Create table and name it "admin" 


CREATE TABLE IF NOT EXISTS `admin` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `firstname` varchar(255) NOT NULL,
   PRIMARY KEY (`user_id`)
);

 

And insert user to admin

INSERT INTO `admin` (`user_id`, `username`, `password`, `firstname`) VALUES
(1, 'aizaz.dinho', '098f6bcd4621d373cade4e832627b4f6', 'Aizaz ');

 

Now you have admin Account Username: Aizaz.dinho, Password: test 


Now create post table that will store our posts

CREATE TABLE IF NOT EXISTS `post` (
  `post_id` int(11) NOT NULL AUTO_INCREMENT,
  `post_title` varchar(255) NOT NULL,
  `post_decscription` varchar(255) NOT NULL,
  `post_content` text NOT NULL,
  `post_date` date NOT NULL,
  `post_image` varchar(255) NOT NULL,
   PRIMARY KEY (`post_id`)
);

 

Now make core folder and save connection.php


<?php 
 session_start();
  try {
      $pdo = new PDO('mysql:host=localhost;dbname=cms', 'root', '');
     
  } catch (PDOException $e) {
    print "Connetion Error!: " . $e->getMessage() . "
";
     die();
 }
 ?>

 

Create functions folder and make Main.php and save in functions folder main.php is main class


<?php
class Main{

         //fetch all posts
 public function get_all_posts(){
  global $pdo;

  $query = $pdo->prepare('SELECT * FROM post order by post_date desc');
  $query->execute();

  return $query->fetchAll(PDO::FETCH_ASSOC);
 }
  //fetch post data by post id 
  public function fetch_data($pid){
  global $pdo;

  $query = $pdo->prepare('SELECT * FROM post where post_id = ? order by post_date desc');
  $query->BindValue(1,$pid);
  $query->execute();

  return $query->fetch();
 }
  //check if user is logged in 
  public function logged_in(){
    return (isset($_SESSION['loggedin'])) ? true : false;
  }
}
?>

Simple Blogger Type Cms Using PHP, PDO
post.php



Save As post.php, post.php is our post template


<?php
 /* Author: Aizaz Ud Din (Aizaz.dinho)*/
 /* Made By: Meralesson.com*/
include_once('core/connection.php');
include_once('functions/main.php'); 
$post  = new Main;
$check = new Main;
$check_login = $check->logged_in();

//Show Post Data By post id 
if(isset($_GET['id'])){
 $pid = $_GET['id'];
 $post = $post->fetch_data($pid);
 ?>
<html>
 <head>
  <title>Cms From - Meralesson.com</title>
  <link rel="stylesheet" href="css/style.css">  
 </head>
 <body>
  <div class="warraper">
  <div class="header">
   <img src="images/img/header.png"/>
  </div>
  <div class="menu">
   <ul>
                        //check user is logged in or not
   <?php if($check_login === false){
   echo '<li><a href="index.php">Home</a></li>
      <li><a href="admin/adminpanel.php">Log in</a></li>';
   }else{
    echo '<li><a href="index.php">Home</a></li>
     <li><a href="add_new_post.php">Create New Post</a></li>
     <li><a href="admin/view_all_posts.php">View All Posts</a></li>
     <li><a href="admin/Logout.php">Logout</a></li>';
   }?>
   </ul>
  </div>
                 <div class="content">
   <div class="left-side">
    <div class="post">
    <div class="post-head">
     <h1><?php echo $post['post_title'];?></h1>
    </div>
    <div class="post-in">
     <img src="<?php echo $post['post_image'];?>"></img>
    </div><br><hr>
    <div class="post-body">
    <?php echo $post['post_content'];?>
    </div>
   </div>
    
   </div>
   <div class="right-side">
   
   </div>
   </div>
   </div>
  </div>
  <div class="footer">
   <ul>
   <li>Made by:<a href="www.meralesson.com">Meralesson.com</a></li>
   <li>This Is Free For Every One, Like us on <a href="http://www.facebook.com/merelessondotcom">facebook</a> For Update and Vist Meralesson.com For Awesome Tutorials</li>
    </ul>
  </div>
 </body>
</html>

 <?php
}else{
 header('Location:index.php');
}

?>



 

Now we will Create Index.php


<?php
 /* Author: Aizaz Ud Din (Aizaz.dinho)*/
 /* Made By: Meralesson.com*/ 
 include_once('core/connection.php');
 include_once('functions/main.php');
 $post  = new Main;
 $check = new Main;
 $posts = $post->get_all_posts();
 $check_login = $check->logged_in();
?>
<html>
 <head>
  <title>Cms From - Meralesson.com</title>
  <link rel="stylesheet" href="css/style.css">  
 </head>


 <body>
  <div class="warraper">
  <div class="header">
   <img src="images/img/header.png"/>
  </div>
  <div class="menu">
   <ul>
                                //check user is logged in or not
    <?php if($check_login == false){
   echo '<li><a href="index.php">Home</a></li>
      <li><a href="admin/adminpanel.php">Log in</a></li>';
   }else{
    echo '<li><a href="index.php">Home</a></li>
     <li><a href="add_new_post.php">Create New Post</a></li>
     <li><a href="admin/view_all_posts.php">View All Posts</a></li>
     <li><a href="admin/Logout.php">Logout</a></li>';
   }?>
   
   </ul>
  </div><div class="content">
                //fetching all post from database 
  <?php foreach($posts as $post){?>
   <div class="left-side">
    <div class="post-show">
    <div class="post-head-s">
     <h1><a href="post.php?id=<?php echo $post['post_id']?>"><?php echo $post['post_title']?></a></h1>
    </div>
    <div class="post-img">
     <a href="post.php?id=<?php echo $post['post_id']?>"><img src="<?php echo $post['post_image']?>"></img></a>
    </div>
    <div class="post-body-s">
     <p><?php echo $post['post_decscription']?></p>
    </div>
    <?php }?>
   <div class="right-side">
   
   </div>
   </div>
   </div>
  </div>
 </div> <div class="footer">
   <ul>
   <li>Made by:<a href="www.meralesson.com">Meralesson.com</a></li>
   <li>This Is Free For Every One, Like us on <a href="http://www.facebook.com/merelessondotcom">facebook</a> For Update and Vist Meralesson.com For Awesome Tutorials</li>
    </ul>
  </div>
 </body>
</html>

Simple Blogger Type Cms Using PHP, PDO
Add_new_post.php


 

Now Create add_new_post.php,


<?php
 /* Author: Aizaz Ud Din (Aizaz.dinho)*/
 /* Made By: Meralesson.com*/ 
 include ('core/connection.php');
 include ('functions/main.php');
 if(isset($_SESSION['loggedin'])===false){
  header('Location: index.php');
 }else{
 //check if user Publish a post
  if($_POST){
  $ptitle = $_POST['post_title'];
  $pdecscription = $_POST['post_dec'];
  $pcontent = $_POST['post_content'];
  $pdate = date("Y-m-d H:i:s");
   if(empty($ptitle) or empty($pdecscription) or empty($pcontent)){
   $errors = '
All fields are required. Please try again
'; }else{ //check if post image isset if (isset($_FILES['post_image'])===true) { if (empty($_FILES['post_image']['name']) ===true) { $errors = '
Please Choose a Post Image
'; }else { //check image format $allowed = array('jpg','jpeg','gif','png'); $file_name = $_FILES['post_image']['name']; $file_extn = strtolower(end(explode('.', $file_name))); $file_temp = $_FILES['post_image']['tmp_name']; if (in_array($file_extn, $allowed)===true) { //rename image name $file_parh = 'images/' . substr(md5(time()), 0, 10).'.'.$file_extn; //move image to our image folder move_uploaded_file($file_temp, $file_parh); $query = $pdo->prepare("INSERT INTO `cms`.`post` (`post_id`, `post_title`, `post_decscription`, `post_content`, `post_date`, `post_image`) VALUES (NULL, ?, ?, ?, ?, ?)"); $query->bindValue(1, $ptitle); $query->bindValue(2, $pdecscription); $query->bindValue(3, $pcontent); $query->bindValue(4, $pdate); $query->bindValue(5, $file_parh); $query->execute(); header('Location: admin/view_all_posts.php'); } } } } } ?><html> <head> <title>Add new post -> Adminpanel - Meralesson.com</title> <link rel="stylesheet" href="css/style.css"> <script type="text/javascript" src="js/jquery.js"></script> <script src="ckeditor/ckeditor.js"></script> </head> <body> <div class="warraper"> <div class="header"> <a href="index.php"><img src="images/img/header.png"/></a> </div> <div class="menu"> <form action="" method="post" enctype="multipart/form-data"> <ul> <li><h2>Post title</h2><input name="post_title" class="inputer" type="text"></input></li> <li><input class="submet" value="Publish" type="submit"></input></li> </ul> </div> <div class="content"> <div class="left-side"> <!--show erros if isset--> <?php if($errors)){ echo $errors; }?> <div class="editer"> <textarea id="editor"rows="3" name="post_content"></textarea> </div> </div> <div class="right-side"> <div class="right-menu"> <ul> <li><h3>Description</h3><textarea rows="3" name="post_dec"></textarea></li> <li><h3>Upload Post Image</h3><input type='file' name="post_image" id="imgInput" /></li> <li><img id="preview" src="#"/></li> </ul> </form> </div> <script> //replace texarea with editor CKEDITOR.replace( 'editor' ); //preview image script function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#preview').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); $('#preview').show(); } } $("#imgInput").change(function(){ readURL(this); }); </script> </div> </div></div> <div class="footer"> <ul> <li>Made by:<a href="www.meralesson.com">Meralesson.com</a></li> <li>This Is Free For Every One, Like us on <a href="http://www.facebook.com/merelessondotcom">facebook</a> For Update and Vist Meralesson.com For Awesome Tutorials</li> </ul> </div> </body> </html> <?php }?>


Simple Blogger Type Cms Using PHP, PDO
adminpanel.php

Make admin folder and create adminpanel.php in admin folder

<?php  
 include ('../core/connection.php');
 include ('../functions/main.php');
 $check = new Main;
 $check_login = $check->logged_in();
 
?>
<!DOCTYPE html>
<html>

<head>

 <link rel="stylesheet" href="../css/style.css"/>
 
</head>

<body>
 <div class="warraper">
  <div class="header">
   <img src="../images/img/header.png"/>
  </div>
  <?php if($check_login === false){?>
  <div class="content">
   <div class="left-side">
    <div class="intro">
    <h2>Assalam o Alaikum</h2>
    <p>
     Hy guys and girls this is our first CMS.I think it is very good for beginner type of CMS.
     And also for those who actually want an simple type Content Management System.
     
    </p>
   </div>
   <div class="intro">
    <h2>Hope u like it</h2>
    <p>
     If you like this CMS then like our facebook page <a href="https://www.facebook.com/Meralessondotcom">meralesson</a> for new updates.<br>

    </p>
   </div>
   </div>
   <?php 
    include('login.php');
   }else{
    header('Location: view_all_posts.php');
   }
   ?>
  <div class="footer">
  
  </div>
 </div>
</body>
</html>
Create Login.php in admin folder login.php, login.php will handle your functions and validations

<?php


 // check if yuser submit data
 if(isset($_POST['username'],$_POST['password'])){
  @$username = $_POST['username'];
  @$password = md5($_POST['password']);
  //check is empty
  if(empty($username) or empty($password)){
   $error  = "
Enter a Username and Password
"; } else{ //check username and password from database $query = $pdo->prepare("SELECT * FROM admin WHERE username = ? AND password = ?"); $query->bindValue(1,$username); $query->bindValue(2,$password); $query->execute(); $num = $query->rowCount(); // if username and password is correct then set sesstion if($num == 1){ $_SESSION['loggedin'] = true; $_SESSION['username'] = $username; header('Location: view_all_posts.php'); exit(); }else{ $error = '
incorrect details!
'; } } } ?><div class="right-side"> <div class="login-box"> <div class="login-header"> <img src="../images/img/meracms.png"></img> </div> <form action="" method="post"> <div class="login-body"> <input type="text" name="username" placeholder="Enter your Username"></input> <input type="password" name="password" placeholder="Enter your Password"></input> </div> <div class="login-footer"> <input type="submit" value="Login"></input> </div> </form> <div class="login-error"> <?php if(isset$error)){ echo $error; } ?> </div> </div> </div> </div> </div>
Create Logout.php in admin folder

&lt?php 
 session_start();
 session_destroy();
 header('Location: adminpanel.php');?>


Simple Blogger Type Cms Using PHP, PDO
View_all_posts.php

Now we will Create view_all_post.php in admin folder which display our Published posts


><!DOCTYPE html>
<html>

<head>
 <link rel="stylesheet" href="../css/style.css"/>
</head>

<body>
<div class="warraper">
  <div class="header">
   <img src="../images/img/header.png"/>
  </div>
  <div class="menu">
   <ul>
    <li><a href="../index.php">Home</a></li>
    <li><a href="../add_new_post.php">Create New Post</a></li>
     <li><a href="logout.php">Logout</a></li>
   </ul>
  </div>
        <div id="content">
   <div class="posts-holder">
   //fetching posts 
   <?php foreach($posts as $post){?>
    <table>
     <tbody>
      <tr class="tr-st">
       <td valign="top" align="center">
        <div class="check">
         <input type="checkbox"></input>
        </div>
       </td>
       <td valign="top" align="left">
        <div class="post-link">
         <a href="../post.php?id=<?php echo $post['post_id'];?>"><?php echo $post['post_title'];?></a>
        </div>
       </td>
       <td valign="top" align="right">
        <div class="post-hidden">
         <a href="edit.php?post_id=<?php echo $post['post_id'];?>">Edit</a>|<a href="../post.php?id=<?php echo $post['post_id'];?>">View</a>|<a href="#" class="post_delete" name="<?php echo $post['post_id']; ?>" onClick="deletepostundefined<?php echo $post['post_id']; ?>)">delete</a>|
        </div>
       </td><?php }?>
       <script type="text/javascript">
       //delete post script
        function deletepost(x){
         var conf = confirm("Are you sure you want to delete this post?");
         if(conf == true){
         window.location = "delete.php?delete_id="+x;
         }
        }
       </script>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
<div class="footer">
   <ul>
   <li>Made by:<a href="www.meralesson.com">Meralesson.com</a></li>
   <li>This Is Free For Every One, Like us on <a href="http://www.facebook.com/merelessondotcom">facebook</a> For Update and Vist Meralesson.com For Awesome Tutorials</li>
    </ul>
  </div>
</body>
</html>
<?php }?>
Make Delete.php in admin folder

<?php
 /* Author: Aizaz Ud Din (Aizaz.dinho)*/
 /* Made By: Meralesson.com*/ 
 include_once('../core/connection.php');
 //check if user is logged in or not
 if(isset($_SESSION['loggedin'])===false){
  header('Location: ../index.php');
 }else{
 // if get delete_id then delete post by get id 
 if(isset($_GET['delete_id'])){
    $del_id = $_GET['delete_id'];
    $query = $pdo->prepare("DELETE FROM `post` WHERE `post`.`post_id` = ?");
    $query->bindValue(1,$del_id);
    $query->execute();
    header('Location: view_all_posts.php');
    exit();
   }
  } 
?>


Simple Blogger Type Cms Using PHP, PDO

edit.php


make edit.php in admin folder, edit.php is same as add_new_post.php but in edit.php will update not insert

fetch_data($pid);
  //if user update post
  if($_POST){
  $ptitle = $_POST['post_title'];
  $pdecscription = $_POST['post_dec'];
  $pcontent = $_POST['post_content'];
  $pdate = date("Y-m-d H:i:s");
   if(empty($ptitle) or empty($pdecscription) or empty($pcontent)){
   $errors = '
All fields are required. Please try again
'; }else{ //check if image is isset if (isset($_FILES['post_image'])===true) { if (empty($_FILES['post_image']['name']) ===true) { $errors = '
Please Choose a Post Image
'; }else { //check image format $allowed = array('jpg','jpeg','gif','png'); $file_name = $_FILES['post_image']['name']; $file_extn = strtolower(end(explode('.', $file_name))); $file_temp = $_FILES['post_image']['tmp_name']; if (in_array($file_extn, $allowed)===true) { //move image to our path $file_parh = 'images/' . substr(md5(time()), 0, 10).'.'.$file_extn; $file_parh_new = '../images/' . substr(md5(time()), 0, 10).'.'.$file_extn; move_uploaded_file($file_temp, $file_parh_new); //update post with new data $query = $pdo->prepare('UPDATE `post` SET `post_title` = ?, `post_decscription` = ?, `post_image` = ?, `post_date` = ?, `post_content` = ? WHERE `post_id` = ?; '); $query->bindValue(1, $ptitle); $query->bindValue(2, $pdecscription); $query->bindValue(3, $file_parh); $query->bindValue(4, $pdate); $query->bindValue(5, $pcontent); $query->bindValue(6, $pid); $query->execute(); header('Location: view_all_posts.php'); } } } } } ?><html> <head> <title>Edit post - Meralesson.com</title> <link rel="stylesheet" href="../css/style.css"> <script src="../ckeditor/ckeditor.js"></script> </head> <body> <div class="warraper"> <div class="header"> <a href="../index.php"><img src="../images/img/header.png"/></a> </div> <div class="menu"> <form action="" method="post" enctype="multipart/form-data"> <ul> <li><h2>Post title</h2><input name="post_title" class="inputer" type="text" value="<?php echo $post['post_title'];?>"></input></li> <li><input class="submet" value="Update" type="submit"></input></li> </ul> </div> <div class="content"> <div class="left-side"> <!---- show erros if isset --> <?php if(isset($errors)){ echo $errors; }?> <div class="editer"> <textarea id="editor"rows="3" name="post_content"><?php echo $post['post_content'];?></textarea> </div> </div> <div class="right-side"> <div class="right-menu"> <ul> <li><h3>Description</h3><textarea rows="3" name="post_dec"><?php echo $post['post_decscription'];?></textarea></li> <li><h3>Upload Post Image</h3><input type='file' name="post_image" id="imgInput" /></li> <li><img id="preview" style="display:block;" src="../<?php echo $post['post_image'];?>"/></li> </ul> </form> </div> <script> //replace texarea with editor CKEDITOR.replace( 'editor' ); function readURL(input) { //image preview function if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#preview').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); $('#preview').show(); } } $("#imgInput").change(function(){ readURL(this); }); </script> </div> </div> <div class="footer"> <ul> <li>Made by:<a href="www.meralesson.com">Meralesson.com</a></li> <li>This Is Free For Every One, Like us on <a href="http://www.facebook.com/merelessondotcom">facebook</a> For Update and Vist Meralesson.com For Awesome Tutorials</li> </ul> </div> </div> </body> </html> <?php }else{ header('Location:index.php'); } } ?>
Download CKEditor Full Package and extract ekeditor to our cms, now the last step make css folder and make style.css file in css folder
/*
 design by Meezan Ud Din
*/

*{
 margin:0px;
 padding:0px;
 width:auto;
 height:auto;
 font-family:"sans-serif",comic-sans-serif;
 color:#333;
 
}

body{
 background:white;
 
}

.warraper{
 width:100%;
 height:auto;
 
}

.header{
 width:100%;
 height:65px;
 background:url('../images/img/header-background.png');
 box-shadow: 0px 0px 3px 0px #333;
 
}
.header img{
 width:200px;
 
}

.menu{
 width:100%;
 height:auto;
 border-bottom: 1px solid #ccc;
 padding: 10px;
}

.menu h2{
 display:inline;
}

.menu ul {
 list-style:none;
 
}

.menu ul li{
 display:inline;
 margin:0px 10px;
 line-height: 2;
}
.menu ul li a{
 color:#333;
 text-decoration:none;
}

.menu ul li a:hover{
 color:black;
 text-decoration:underline;
}

.content{
 width:100%;
 height:auto;
}
.post-in{

}
.left-side{
 float:left;
 border-right:1px solid #ccc;
 overflow:auto;
}

.right-side{
 float:right;
 
}

.footer{
 width:100%;
 height:auto;
 border-top:1px solid #ccc;
 float:left;
}
.footer ul li{
 list-style: outside none none;
 margin: 2px 10px;
}


.footer a{
 color:#8fc400;
 text-decoration:none;
}

.footer a:hover{
 text-decoration:underline;
}


.login-box{
 width:350px;
 height:400px;
 margin:0px auto;
 background:white;
 box-shadow: 0px 0px 2px #B0E51F;
 margin: 100px;
}
.login-box img{
 width:350px;
 height:auto;
 max-height:200px;
}
.login-body{
 text-align:center;
}
.login-body input{
 border: 1px solid #CCC;
 height: 25px;
 padding: 5px;
 width: 200px;
 margin: 3px;
 border-radius:3px;
 
}
.login-body input.click{
 border:1px solid #8fc400;
 
}
.login-footer {
 text-align:center;
}
.login-footer input{
 border: 1px solid #CCC;
 height: 25px;
 padding: 5px;
 width: 100px;
 margin: 3px;
 background:#3890F2 none repeat scroll 0% 0%;
 line-height:0px;
 border-radius:4px;
 color:white;
}

.login-footer  input:hover{
 background:#579AE4 ;
 box-shadow:0px 0px 2px 0px blue;
 font-weight:bold;
}
.login-footer input:active{
 box-shadow:0px 0px 0px 0px;
 font-weight:normal;
}
.login-error{
 margin:30px;
 font-size:11px;
 color:#333;
}
.login-error p{
 color:#333;
 overflow:auto;
}

.error{
 width:auto;
 height:auto;
 border:1px dashed #8fc400;
 padding:10px;
 margin:0px auto;
 
}


.editer{
 width:900px;
 height:500px;
 background:#E3E3E3 none repeat scroll 0% 0%;
}

.side-in{
 width:auto;
 height:auto;
 border:1px solid #ccc;
}

.side-in input{
 width:450px;
 height:30px;
 border: 1px solid #ccc;
 border-radius: 4px;
 color: #333;
 font-weight: bold;
 padding: 0px 10px;
 
}
.side-in textarea{
 float:right;
 clear:both;
 overflow:auto;
}

.dec-text h3
{
 float:right;
 overflow:auto;
 
}

.inputer{
 width: 600px;
 height: 30px;
 border: 1px solid rgb(204, 204, 204);
 border-radius: 4px;
 margin: 0px 10px;
 padding: 0px 10px;
 font-size: 17px;
 font-weight: bolder;
 color: rgb(51, 51, 51);

}

.submet{
 width: 70px;
 height: 30px;
 background: rgb(248, 147, 60) none repeat scroll 0% 0%;
 border: 1px solid rgb(204, 204, 204);
 border-radius: 3px;
 color: rgb(255, 255, 255);
 font-weight: bolder;
 box-shadow: 0px 0px 0px 0px;
 
}

.submet:hover{
 background:#FC6D2B none repeat scroll 0% 0%;
 cursor:pointer;
}

.submet:active{
  box-shadow:0px 0px 3px 0px #fc6d2bh;
  border:1px solid #red;
}

.btn3{
 width:90px;
 height:30px;
 background: #DDD none repeat scroll 0% 0%;
 border: 1px solid rgb(204, 204, 204);
 border-radius: 3px;
 color: rgba(114, 110, 110, 0.78);
 font-weight: bolder;
 box-shadow: 0px 0px 0px 0px;
}
.btn3:hover{
 border:1px solid #A9B0FF;
 background:#d8d8d8 none repeat scroll 0% 0%;
 cursor:pointer;
 color:rgba(75, 66, 66, 0.8);
}

.btn3:active{
  box-shadow:0px 0px 2px 0px #A9B0FF;
  
}

.error2{
 width:auto;
 height:auto;
 background:orange;
 color:#cxcc;
 
}

.error2 p{
 color: #902424;
 padding: 2px 10px;
 font-size:14px;

}

.right-menu{
 width:auto;
 height:auto;
 
}
.right-menu h1{
 overflow:auto;
}
.right-menu ul li{
 display:block;
 margin:10px;
 
}

.right-menu ul li textarea{
 width: 300px;
 height: 100px;
 border: 1px solid #ccc;
 border-radius: 3px;
 margin: 10px;
 padding:5px;
 resize:none;
}

.right-menu ul li h3{
 font-weight: normal;
 color: #544D4D;
 font-family: sans-serif,verdena;
}
.in-label{
 width: 300px;
 height: 30px;
 margin: 10px;
 border: 1px solid #ccc;
 border-radius: 3px;
 padding: 0px 5px;
}

.posts-holder{
 width:auto;
 height:500px;
 padding:10px;
 background:white;
 
}
.post{
 width: 750px;
 height: auto;
 padding: 10px;
}
.post-in{
 width:500px;
 margin:0px auto;
}

.post-in img{
 width: auto;
 max-width: 500px;
}

.post-head h1{
 padding:10px 0px;
}
.post-head-s h1{
 padding:10px 0px;
}
.post-body{
 margin:10px;
 padding: 10px;
 border: 2px dashed #8FC400;
}
.post-body-s{
 padding: 10px;
 overflow: hidden;
 display: block;
 height: 230px;
}
.post-img img{
 width:200px;
 float:left;
 margin:10px;
 
}
.post-show{
 width: 670px;
 overflow: hidden;
 padding: 10px;
 margin: 10px;
 border: 2px dashed #8fc400;
 border-radius: 3px;
}

.intro{
 width:500px;
 height:auto;
 margin:15% 5%;
 overflow:auto;
 border:2px dashed #8fc400;
 border-radius:4px;
 padding:10px;
}
.intro p{
    padding:10px;
 overflow:auto;
 
}

.posts-holder{
 width:auto;
 height:500px;
 padding:10px;
 background:white;
 
}
.posts-holder table{
 width:100%;
 
}
.posts-holder table tr {
 width:auto;
 height:80px;
 border-collapse:collapse;
 
 
}
.posts-holder table tr td{
 border-bottom: 1px solid #EEB;
    padding-top: 30px;
    padding-left: 10px;
}
.tr-st a{
 margin:0px 10px;
}

.acf_wysiwyg iframe {
    height: 450px;
}

#preview{
 width: 250px;
 height: 250px;
 border: dashed #83c400;
 display:none;
}

Comments

  1. Thank you for the article. The demo link on this page does not work anymore but it's ok I guess. Can you create an article on coding a CMS using Codeigniter, it possible. From what I have read (I'm new into PHP coding) it handles the security aspects of a web app, so we wouldn't have to worry about that. Thanks again.

    ReplyDelete
    Replies
    1. I will make with Codeigniter but it will take some time, Demo link fixed

      Delete
  2. Bro, i uploaded all the files on my web server but when i tried to access the index.php via my browser i got an error saying

    " Connetion Error!: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) "

    What i have done wrong?....
    Do i need to create a database first?
    If yes then can you give me sql files which i can import directly via phpMyAdmin i am unable to understand this tutorial as i am a novice, please help me installing this cms on my server.

    You can contact me on [email protected]

    ReplyDelete
    Replies
    1. Sorry for late replay, Yes you need to create the database first download the sql file from here https://drive.google.com/file/d/0B4q4IW6m2bK9bnZWVE13WFV3a28/

      Delete
  3. Anonymous1/26/2017

    Thank you!!! :)

    ReplyDelete
  4. hi !! what is written in js folder

    ReplyDelete
  5. Anonymous5/07/2017

    Hey man, nice tutorial. I am having problems however evertime I try to login it gives me incorrect details. I downloaded and imported your sql file so everything should be alright, somehow it isn't. What could the problem be?

    ReplyDelete
    Replies
    1. Anonymous5/08/2017

      Nevermind, it was my mistake. Although what I would suggest is to use password_hash and password_verify for the password encryption.

      Delete
  6. Hey men I use pdo one help me.
    How to string array bind IN () clause.
    Below my codes.
    prepare ('select * from product where category_name IN (:cname) ');
    $sql->bindParam (':cname',implode ("','",$name) );
    $sql->execute ();

    Above codes is bind only one array name I click second checkbox the result not found.

    ReplyDelete
  7. thank you very much I planted on news cms using PDO with image

    ReplyDelete

Post a Comment