i got what i want but i can ONLY view 1 image and i m trying to view all images in the directory but i still cannot
here is part of my code
$i=0;
while (($file = readdir($dh)) != false) {
$i++;
if($i > 2) $file_array[$i]['name'] = $dir.'/'.$file."";
}
$num=2;
while($num < $j){
$num++;
Draw($file = $file_array[$num]['name']);
}
function Draw($file){
$WaterMark_Transparency = "50";
// Import the images to use...
// the watermark is a gif (transparency without the white.)
$WaterMark = imageCreateFromGIF("water.gif");
$Main_Image = imageCreateFromjpeg($file);
// Get the width and height of each image.
$Main_Image_width = imageSX($Main_Image);
$Main_Image_height = imageSY($Main_Image);
$WaterMark_width = imageSX($WaterMark);
$WaterMark_height = imageSY($WaterMark);
// calculate the position of the WaterMark
$MaterMark_x = ($Main_Image_width - $WaterMark_width);
$MaterMark_y = ($Main_Image_height / 4);
//put the watermark on top of the background image.
imageCopyMerge($Main_Image, $WaterMark, $MaterMark_x, $MaterMark_y, 0, 0, $WaterMark_width, $WaterMark_height, $WaterMark_Transparency);
imagettftext($Main_Image, 10, 60, 25, 110, 0, "Verdana", "HAPPY");
// Let the browser know that it is an image..
header("Content-Type: image/jpeg");
// show the image in png format(sharper image)
Imagejpeg ($Main_Image);
}