lundi 28 septembre 2015

Php default image when image not exist

i have a little script for my cms. I'm trying to create a default image (default.png) when image linked not exist. I have all images in another website and i created this code:

<?php 
$immagine_e = $_GET('http://ift.tt/1sEEnCY'.$provincia'.png');
?>
<?php if ($immagine_e ==''){ ?> 
<img src="images/default.png" class="margin-top-negative-70" alt="">
<?php } else { ?> 
<img src="$immagine_e" class="margin-top-negative-70" alt="">
<?php } ?>

$provincia = name of city. For example milano and if http://ift.tt/1KG0iTL not exist i need default images. If exist i need this image. Can anyone help me?

Aucun commentaire:

Enregistrer un commentaire