How to display an image with PHP session [closed]

-4

What can I do to display an image (only the address is saved) that is stored in the database using the sessions?

    
asked by anonymous 22.09.2018 / 14:35

1 answer

1

Vinicius, as you did not give any details of what you have code, I'm giving you a very generic example of how it could be done, but, this is far from ideal to be done, it's just a notion of how it could be .

<?php
$endImagem = funcaoSelectImagem(); // Retorna o campo com o endereço completo da imagem.
if ($endImagem != NULL) {
   ?>
   <img src="<?php print($endImagem) ?>" width="200" height="200">
   <?php
} else {
   print("Imagem não existe.");
}
?>
    
22.09.2018 / 17:38