PHP not rendering html -
PHP not rendering html -
i writing image management script in php. of php code regarding image management works fine. problem script fails render little amount of html @ top includes animated loading gif.
depending on number of images beingness managed, can take time html @ top render. have tried place in function , phone call function after html script goes right image processing.
this page beingness called iframe page in iframe.
<?php $level = '../../'; include('class.upload.php'); $folder = $_request['folder']; # render success page echo '<html><body>'; echo '<h3 style="color: red">processing...</h3>'; echo 'this might take awhile... patience much appreciated.'; echo '<br><br><br><div style="text-align: center"><img src="ajaxloader.gif"></div>'; echo '</body></html>'; $icon = $_request['icon']; $thumb = $_request['thumb']; $small = $_request['small']; $medium = $_request['medium']; $large = $_request['large']; $xlarge = $_request['xlarge']; foreach(glob('images/temp/*') $image) { if($icon >= 1){copy($image, 'images/100/' . basename($image));} if($thumb >= 1){copy($image, 'images/150/' . basename($image));} if($small >= 1){copy($image, 'images/320/' . basename($image));} if($medium >= 1){copy($image, 'images/640/' . basename($image));} if($large >= 1){copy($image, 'images/960/' . basename($image));} if($xlarge >= 1){copy($image, 'images/1280/' . basename($image));} } # xlarge folder $startdir= 'images/1280/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 1280){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 1280; $handle->image_ratio_y = true; $handle->process($folder.'/1280/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # big folder $startdir= 'images/960/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 960){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 960; $handle->image_ratio_y = true; $handle->process($folder.'/960/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # medium folder $startdir= 'images/640/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 640){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 640; $handle->image_ratio_y = true; $handle->process($folder.'/640/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # little folder $startdir= 'images/320/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 320){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 320; $handle->image_ratio_y = true; $handle->process($folder.'/320/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # thumb folder $startdir= 'images/150/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 150){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 150; $handle->image_ratio_y = true; $handle->process($folder.'/150/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # icon folder $startdir= 'images/100/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){ list($width, $height) = getimagesize($startdir.$image_file); if($width >= 100){ $handle = new upload($startdir.$image_file); if ($handle->uploaded) { $handle->file_name_body_add = '_large'; $handle->image_resize = true; $handle->image_x = 100; $handle->image_ratio_y = true; $handle->process($folder.'/100/'); if ($handle->processed) {$handle->clean();} else {echo 'error : ' . $handle->error;} } } } # unlink temp folder images $startdir= 'images/temp/'; $dir="$startdir$subdir";$array_dir=array();$array_file=array();if(is_dir($dir)){if($dh=opendir($dir)){while(($file=readdir($dh))!==false){$filename=$file;$filetype=filetype($dir.$file);if($filename==".."or$filename=="."){echo"";}else{if($filetype=="file"){$array_file[]=$filename;}elseif($filetype=="dir"){$array_dir[]=$filename;}}}closedir($dh);}}sort($array_dir); foreach ($array_file $image_file){unlink($startdir.$image_file);} echo '<script language="javascript">window.location="success.php"</script>'; ?
>
any assistance much appreciated, pete
php html
Comments
Post a Comment