As i am developing the site offline on my computer, i dont have any problem with file locating.
To put images on the page first i check if the respective image exsits
I check the existence of the image if the image doesnt exist then i print the 'no_image.jpg' file.Code:$sql = mysql_query("SELECT * FROM urunler order by kod") or die(mysql_error()); if(mysql_num_rows($sql) == 0) { echo'<tr><td>Yazar bulunamadi!</td></tr>'; } else { while($urun = mysql_fetch_object($sql)) { $filename = '/images/products/'.$urun->kod.'.jpg'; echo '<div id="box"> '.$urun->kod.''; if (file_exists($filename)) { echo ' <p align = "center"><a href="/images/products/'.$urun->kod.'.jpg" rel="lightbox" title="'.$urun->tanim.'" width="100"> <img src="images/products/'.$urun->kod.'.jpg" width="90" border="0" align="top"></a></p>'; } else { echo ' <p align = "center"><a href="images/products/no_image.jpg" rel="lightbox" title="'.$urun->tanim.'" width="100"> <img src="images/products/no_image.jpg" width="90" border="0" align="top"></a></p>'; }
Although i have images for most of the entries, for all the entries page prints 'no_image.jpg' file.
It means that it can access the directory ''images/products'. But
why i cant access and check existence of image with
$filename = '/images/products/'.$urun->kod.'.jpg';
As i told you it works offline fine on my computer.
my website is http://www.omega-intertrade.com/
You can also check it here.


Reply With Quote
Bookmarks