name : add_home.php
<?php 
    
include('../config/config.php');

 $images1 = $_FILES['file']['tmp_name'];
 $images_name1 = $_FILES['file']['name'];
 $images = "images/home/".$images_name1;

 move_uploaded_file($_FILES['file']['tmp_name'],"../images/home/".$_FILES["file"]["name"]);
 $sql = "INSERT INTO homes (h_image) VALUE ('".$images."')";

 $res = $conn->query($sql);
 if($res === TRUE){
     echo 1;
 }else{
     echo 0;
 }

 ?>

© 2024 UnknownSec