Page 1 of 1

displaying an image on error

Posted: Wed Jan 10, 2007 4:58 am
by mxrideruk
i am currently showing my images by this method
<img src="../images/release_images/<?php echo $row_full_release['image_2']; ?>" width="245" height="184" />

and if the image is missing it shows the missing image symbol but i want it to show a default image
can some one help me out
cheers
kev

Posted: Wed Jan 10, 2007 5:56 am
by bokehman

Code: Select all

<img src="../images/release_images/<?php 
    echo(
        @getimagesize('../images/release_images/'.@$row_full_release['image_2'])?
        $row_full_release['image_2']:
        'default.jpg'
    ) 
?>" width="245" height="184" />