hello all, I am just using <?=stripslashes($row[description])?> PHP: to show information from the database. The problem is if there is a broken image in there it takes ages for the page to load. it takes about 1-2 minutes. If the image is ok, there is no problem. it is loading so fast. (Sometimes it will load very fast even if the image is broken) what can i do to solve this problem? thanks
The images will still be run through the PHP server but this may help site loading. I wrote a function to see if the image is a.) really an image or not and b.) if it's available or not. If it's not available the function will return false and from there you can (or if you give me more specifics I can) write a very quick (I'll leave an example) script to stop parsing the image. function chkImg($img){ $types = array("image/bmp","image/jpeg","image/pjpeg","image/jpg","image/pjpg","image/png","image/ppng","image/gif","image/pgif"); @$data = getimagesize($img); if(in_array($data['mime'],$types,true)){ return true; }else{ return false; } } PHP: You could try something like this for the image check: <?php chkImg(string $img) ? true : die("You wouldn't really want to use a die here because it would stop operation but you get the point!"); ?> PHP: Regards, Dennis M.