תנסה את זה:
PHP קוד:
<?php
$img = $_GET['i'];
$ext = strtolower(array_pop(explode('.' , $img)));
$allow_ext = array('png' , 'bmp' , 'gif' , 'jpg');
if(!in_array($ext , $allow_ext))
{
die('סיומת הקובץ לא מאופשרת להצגה');
}
if(!file_exists($img))
{
die('הקובץ לא נמצא על השרת');
}
echo "<img width=\"500\" height=\"400\" src=\"{$img}\" alt=\"image bla blalba\" />";
?>