Forum Moderators: coopster
include 'pickimage.php';
pickimage.php should get 4 thumbnails/images and links from my other site and display it on the header part. But I noticed that most of the time the picture isn't loaded. The hotlink protection is also disabled.
is there a way to wait or make sure the images are loaded before the remaining portion of the display template code executes?
Thanks in advance.
using array_push() [php.net...] and in_array()
[php.net...]
If the files are not found maybe have a set of default images that are used so you at least get an image or an alternate path to the files.
<table align='center'><tr><?php
include 'config.php';
include 'opendb.php';
$query="SELECT `image_url_table`.`thumb_url` , `ads_table`.`title` , `image_url_table`.`classified_id` , `ads_table`.`price`FROM `image_url_table` , `ads_table`WHERE `image_url_table`.`classified_id` = `ads_table`.`id`ORDER BY rand() LIMIT 4 ";
$result = mysql_query($query);
while(list($picture,$title,$id,$price)= mysql_fetch_row($result))
{
$imgloc="http://www.my_ads_website.com/ads/$picture";
echo "<td width='27%' align='center' style='border-left: 1px solid rgb(0,64,128); border-bottom: 1px solid rgb(0,64,128); border-right: 1px solid rgb(0,64,128); border-top: 1px solid rgb(0,64,128) ';><font size='-2' face='verdana,helvetica,arial'><a target='_new' href='http://www.my_ads_website.com/ads/index.php?a=2&b=$id'><img src='$imgloc' border='0'></a><br><a class='link3' href='http://www.my_ads_website.com/ads/index.php?a=2&b=$id'>",stripslashes(urldecode($title)),"</a><br>",stripslashes(urldecode($price)),"<br></font></td>";
}
include 'closedb.php';
?>
</tr></table>