Hi again,
Thanks for the quick replys!
Heres what I've tried, with using code from the "Multi-column Results" snippet.
<?php
$websiteurl = 'http://www.xxxxx.co.uk/beta/';
$dir = "images/fascinators/mandy/";
// *********************************** Functions
function RemoveExtension($strName)
{
$ext = strrchr($strName, '.');
if($ext !== false)
{
$strName = substr($strName, 0, -strlen($ext));
}
return $strName;
}
// *********************************************
$dh = opendir($dir);
$i = 0;
$max_columns = 3;
echo '<table cellspacing="3" cellpadding="3">';
while (($file = readdir($dh)) !== false) {
$blah = $websiteurl.$dir.$file;
$ProductColourName = RemoveExtension($file);
$ProductColourName = ucwords($ProductColourName);
if(($file != ".") and ($file != "..")) {
// open row if counter is zero
if($i == 0)
{
echo '<tr><td><img src="'. $blah .'" alt="'. $blah .'" name="'. $blah .'" width="147" height="146" /></td>';
// increment counter - if counter = max columns, reset counter and close row
if(++$i == $max_columns)
{
echo '</tr>';
$i=0;
} // end if
} // end while
// clean up table - makes your code valid!
if($i < $max_columns)
{
for($j=$i; $j<$max_columns;$j++)
echo '<td> </td>';
}
//echo '<tr><td><img src="'. $blah .'" alt="'. $blah .'" name="'. $blah .'" width="147" height="146" /><br></td></tr>';
//echo '<tr><td><a href="'. $blah .'">'. $ProductColourName .'</a><br></td></tr>';
}
}
echo '</tr>';
echo '</table>';
closedir($dh);
?>
I'm not having much luck as only one image is appearing. Anyone have any ideas?
Thanks,
Jase