Well the point is that I do not know how to validate the following, in the database I capture the url of an image and then I show it with a echo
in php, what I try to do is validate the image either jpg or png to then export it in an excel file and I see the image, for this I'm using the PHPExcel export library and it's where it gets complicated, it only works if I use jpg or png but not 2 at the same time what I try to do through a validation ... code in the library:
//Consulta
$sqli=mysqli_query($conn, "select logo from perfil where idperfil = 1");
foreach ($sqli as $key => $value) {
$value['logo']; //ruta de la imagen
}
?>
<img class="img-responsive" name="imagefile" id="imagefile" src="<?php echo "../".$value['logo']?>" alt="Logo"> //mostrando la imagen
<?php
$fila = 7; //Establecemos en que fila inciara a imprimir los datos
//Validación de imagen en png o jpeg Aqui falla, solo puedo utilizar 1
if($_FILES['imagefile']['type'] == "image/jpg"){
$gdImage = imagecreatefromjpeg("../".$value['logo']);//Logotipo JPG
}elseif($_FILES["imagefile"]["type"] == "image/png"){
$gdImage = imagecreatefrompng("../".$value['logo']);//Logotipo JPG
}