<?

function createthumb($fname)							//CREATE THUMBNAIL

{  

  

   $size=getimagesize("img/$fname");

   $wp=$size[0];

   $hp=$size[1];

   $h=100;

   $w=$wp*$h/$hp;

   $originalimg=@imagecreatefromjpeg("$fname");

   $thumb =@imagecreatetruecolor($w,$h);

   @imagecopyresized($thumb,$originalimg,0,0,0,0,$w,$h,$wp,$hp);

   @imagejpeg($thumb,"img/$fname");

   @imagedestroy($thumb);

}

?>