Hi Perad, Thanks fo rthe quick response. My code.. [code]<?php error_reporting(0); $folder = ("../cane-corso/images/gallery/"); $num = $_GET["num"]; $dir = opendir($folder); print"<HTML><HEAD><TITLE>Cane Corso Slide Show</TITLE><META NAME=\"Author\" CONTENT=\"Ashley Byrne\"><META NAME=\"Keywords\" CONTENT=\"Image Gallery Slideshow\"><META NAME=\"Description\" CONTENT=\"\"><link rel=\"stylesheet\" href=\"style2.css\"></HEAD><BODY bgcolor=\"#FF99CC\"><center><table border=\"5\" cellspacing=0 cellpadding=0 width=\"100%\" height=\"100%\" bgcolor=\"#FF99CC\"><table bgcolor=\"#FF99CC\">"; $dir = opendir($folder); $i=1; while ($a = readdir($dir)) { if($a != "." && $a != ".." && $a != "text"){ $files[$i] = $a; ++$i; } } $total = count($files); if ($num==""){ $num=="1"; } // resize the image if its too big $maxwidth="600"; list($width, $height, $type, $attr) = getimagesize($gallery.$folder.$files[$num]); if($width>$maxwidth){ $widthpc = round(($maxwidth/$width)*100); $width = round(($width*$widthpc)/100); $height = round(($height*$widthpc)/100); $attr="width=".$width." height=".$height; } Else{ $attr="width=".$width." height=".$height; } print "<tr><td><center><b>".substr($files[$num],0,-4)."</b> (". $num. " of ". $total.")</b></td></tr>"; print "<tr><td><center><img src=\"".$gallery.$folder.$files[$num]."\" ".$attr." border=1><br></td></tr>"; print "<tr><td><br><center><a href=\"javascript:parent.window.close()\"><font color=\"white\">--| End slideshow |--</a></td></tr>"; while ($num < $total){ $num = ($num+1); print "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"></td></tr></table>"; } ?>[/code]