OXIESEC PANEL
- Current Dir:
/
/
home
/
u432548786
/
domains
/
it-tas.com
/
public_html
/
admin
/
includes
Server IP: 191.96.63.230
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
css.php
1.1 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
db_config.php
215 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
delete_category.php
1.86 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
footer.php
349 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
header.php
1.16 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
js.php
3.47 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
sidebar.php
4.22 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
slider.php
464 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
Editing: delete_category.php
Close
<?php include("includes/db_config.php"); if(isset($_GET['id'])) { //var_dump($_GET);exit(); $id = $_GET['id']; $sqlct="select * from category where id='$id'"; $cresult = mysqli_query($conn, $sqlct); $ctres= mysqli_fetch_array($cresult); $name = strtolower(str_replace(" ", "-", $ctres['cat_name'])); if(file_exists('../'.$name)) { $dir = "../$name"; $dir = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); $dir = new RecursiveIteratorIterator($dir,RecursiveIteratorIterator::CHILD_FIRST); foreach ( $dir as $file ) { $file->isDir() ? rmdir($file) : unlink($file); } $dir = "../$name"; if(rmdir($dir)){ $sql=" DELETE FROM category WHERE id={$_GET['id']}"; if (mysqli_query($conn,$sql)) { echo " <script> alert('Your Category have successfully Deleted!!!'); location.replace('category.php'); </script>"; } else { echo " <script> alert('Something went wrong, please try again!!!'); location.replace('category.php'); </script>"; } } } else{ $sql=" DELETE FROM category WHERE id={$_GET['id']}"; if (mysqli_query($conn,$sql)) { echo " <script> alert('Your Category have successfully Deleted!!!'); location.replace('category.php'); </script>"; } else { echo " <script> alert('Something went wrong, please try again!!!'); location.replace('category.php'); </script>"; } } } ?>