Jump to content

Fetching Images Randomly Into HTML Table


eMonk

Recommended Posts

I want to randomly fetch images + their text into an html table (7 per row max). I haven't got into mysql yet so i'm looking for a pure php solution.

 

HTML Table Format:

<table width="730" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
<td><div align="center"><a href="#"><img src="images/php.gif" width="90" height="120" border="0"></a><br>text</div></td>
</tr>
</table>

 

I have about 20+ different pages that will be using this code and want each to load their images + text randomly. There won't be more then 50-60 entries for each page. Most will be under 20 entries. A new <tr><td> will have to be created for each 7 displayed. What's the best way of doing this w/o the aid of mysql?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.