two weeks ago the application worked well but, the last week i had problems trying to upload images to my data base, i create a name, image and type of mime attribute in the php file and in the database, if anyone have an idea please help
php file
'<?php
ini_set('session.save_path',getcwd(). '/tmp');
error_reporting(E_ERROR);
session_start();
$idInmobi=$_SESSION['idInmobiliaria'];
require('conexion.php');
$query="SELECT * FROM Propiedades";
$resultado=$mysqli->query($query);
if(isset($_POST['eviar'])){
$Estado=$_POST['Estado'];
$Municipio=$_POST['Municipio'];
$Inmueble=$_POST['TipoInm'];
$Precio=$_POST['Precio'];
$Cuartos=$_POST['Cuartos'];
$Banos=$_POST['Banos'];
$VentaR=$_POST['VentaRenta'];
$Descripcion=$_POST['Descripcion'];
if(!empty($_FILES['Imagen1']) && !empty($_FILES['Imagen2']) && !empty($_FILES['Imagen3']) && !empty($_FILES['Imagen4']) && !empty($_FILES['Imagen5']) && !empty($_FILES['Imagen6']) && !empty($_FILES['Imagen7']) && !empty($_FILES['Imagen8']) && !empty($_FILES['Imagen9'])){
$nombreImagen=$_FILES['Imagen1']['name'];
$imagenTemporal=$_FILES['Imagen1']['tmp_name'];
$type=$_FILES['Imagen1']['type'];
$nombreImagen2=$_FILES['Imagen2']['name'];
$imagenTemporal2=$_FILES['Imagen2']['tmp_name'];
$type2=$_FILES['Imagen2']['type'];
$nombreImagen3=$_FILES['Imagen3']['name'];
$imagenTemporal3=$_FILES['Imagen3']['tmp_name'];
$type3=$_FILES['Imagen3']['type'];
$nombreImagen4=$_FILES['Imagen4']['name'];
$imagenTemporal4=$_FILES['Imagen4']['tmp_name'];
$type4=$_FILES['Imagen4']['type'];
$nombreImagen5=$_FILES['Imagen5']['name'];
$imagenTemporal5=$_FILES['Imagen5']['tmp_name'];
$type5=$_FILES['Imagen5']['type'];
$nombreImagen6=$_FILES['Imagen6']['name'];
$imagenTemporal6=$_FILES['Imagen6']['tmp_name'];
$type6=$_FILES['Imagen6']['type'];
$nombreImagen7=$_FILES['Imagen7']['name'];
$imagenTemporal7=$_FILES['Imagen7']['tmp_name'];
$type7=$_FILES['Imagen7']['type'];
$nombreImagen8=$_FILES['Imagen8']['name'];
$imagenTemporal8=$_FILES['Imagen8']['tmp_name'];
$type8=$_FILES['Imagen8']['type'];
$nombreImagen9=$_FILES['Imagen9']['name'];
$imagenTemporal9=$_FILES['Imagen9']['tmp_name'];
$type9=$_FILES['Imagen9']['type'];
//se crea archivo temporal binario
$img_tmp=fopen($imagenTemporal, 'r+b');
$imagen=fread($img_tmp, filesize($imagenTemporal));
fclose($img_tmp);
$img_tmp2=fopen($imagenTemporal2, 'r+b');
$imagen2=fread($img_tmp2, filesize($imagenTemporal2));
fclose($img_tmp2);
$img_tmp3=fopen($imagenTemporal3, 'r+b');
$imagen3=fread($img_tmp3, filesize($imagenTemporal3));
fclose($img_tmp3);
$img_tmp4=fopen($imagenTemporal4, 'r+b');
$imagen4=fread($img_tmp4, filesize($imagenTemporal4));
fclose($img_tmp4);
$img_tmp5=fopen($imagenTemporal5, 'r+b');
$imagen5=fread($img_tmp5, filesize($imagenTemporal5));
fclose($img_tmp5);
$img_tmp6=fopen($imagenTemporal6, 'r+b');
$imagen6=fread($img_tmp6, filesize($imagenTemporal6));
fclose($img_tmp6);
$img_tmp7=fopen($imagenTemporal7, 'r+b');
$imagen7=fread($img_tmp7, filesize($imagenTemporal7));
fclose($img_tmp7);
$img_tmp8=fopen($imagenTemporal8, 'r+b');
$imagen8=fread($img_tmp8, filesize($imagenTemporal8));
fclose($img_tmp8);
$img_tmp9=fopen($imagenTemporal9, 'r+b');
$imagen9=fread($img_tmp9, filesize($imagenTemporal9));
fclose($img_tmp9);
//Envio de carcteres a la base de datos
$imagen=mysqli_real_escape_string($mysqli,$imagen);
$imagen2=mysqli_real_escape_string($mysqli,$imagen2);
$imagen3=mysqli_real_escape_string($mysqli,$imagen3);
$imagen4=mysqli_real_escape_string($mysqli,$imagen4);
$imagen5=mysqli_real_escape_string($mysqli,$imagen5);
$imagen6=mysqli_real_escape_string($mysqli,$imagen6);
$imagen7=mysqli_real_escape_string($mysqli,$imagen7);
$imagen8=mysqli_real_escape_string($mysqli,$imagen8);
$imagen9=mysqli_real_escape_string($mysqli,$imagen9);
}else{
echo'<script languaje="Javascript">alert("Debes de subir al menos una imagen "); history.back(); </script>';
}
$que="INSERT INTO Propiedades (Estado, Municipio, TipoInmueble, Precio, NRecamaras, Nbanos, Tipo, Descripcion, Imagen1, NombreImagen1, TipoImagen1, Imagen2, NombreImagen2, TipoImagen2, Imagen3, NombreImagen3, TipoImagen3, Imagen4, NombreImagen4, TipoImagen4, Imagen5, NombreImagen5, TipoImagen5, Imagen6, NombreImagen6, TipoImagen6, Imagen7, NombreImagen7, TipoImagen7, Imagen8, NombreImagen8, TipoImagen8, Imagen9, NombreImagen9, TipoImagen9, IdentificadorInmobiliaria) VALUES ('$Estado','$Municipio','$Inmueble','$Precio','$Cuartos','$Banos','$VentaR','$Descripcion','$imagen','$nombreImagen','$type','$imagen2','$nombreImagen2','$type2','$imagen3','$nombreImagen3','$type3','$imagen4','$nombreImagen4','$type4','$imagen5','$nombreImagen5','$type5','$imagen6','$nombreImagen6','$type6','$imagen7','$nombreImagen7','$type7','$imagen8','$nombreImagen8','$type8','$imagen9','$nombreImagen9','$type9','$idInmobi')";
$result=$mysqli->query($que);
if($result!=false){
echo '<script>window.location.assign("inicioAdministradorPropiedades.php");alert("El registro se realizo exitosamente");</script>';
}else{
echo'<script languaje="Javascript">alert("Lo sentimos algo salio mal, vuelve a intentarlo"); history.back(); </script>';
}
}
?>'