I have this function, which does not recognize me $_SESSION['id_usuario']
variable%, showing me the indefinite and the question is if there is, as I am using it in other functions.
public function mostrarImagenController($datos){
list($ancho,$alto)=getimagesize($datos);
if ($ancho < 1024 ||$alto < 768) {
echo 0;
}else{
$aleatorio=mt_rand(100,999);
$ruta="../../views/imagest/galeria/galeria".$aleatorio.".jpg";
$nuevo_ancho=1024;
$nuevo_alto=768;
$origen=imagecreatefromjpeg($datos);
#imagecreatetruecolor — Crear una nueva imagen de color verdadero
$destino=imagecreatetruecolor($nuevo_ancho, $nuevo_alto);
#imagecopyresized() - copia una porción de una imagen a otra imagen.
#bool imagecopyresized( $destino, $origen, int $destino_x, int $destino_y, int $origen_x, int $origen_y, int $destino_w, int $destino_h, int $origen_w, int $origen_h)
imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevo_ancho, $nuevo_alto, $ancho, $alto);
imagejpeg($destino,$ruta);
$id_tienda5=$_SESSION['id_usuario'];
$datosController=array("ruta"=>$ruta,
"id"=>$id_tienda5);
DatosTienda::subirImagengaleriaModel($datosController,"tiendas_cafe");
$respuesta=DatosTienda::mostrarImagengaleriaModel($datosController,"tiendas_cafe");
echo $respuesta['img_galeria_tienda'];
}
}