Help with PHP layout?

Nik

New member
This isn't so much a coding question with PHP I'm having problem with layout here is my PHP code
-----------------
code to display images
----------------
<?php
$path='images/';
$handle=opendir($path);
if ($handle = opendir('images/')) {
while (($file = readdir($handle))!==false) {
if(strlen($file)>3)
{
echo "<img src=$path$file width='200px' height='200px'/> **";
}
}
}
closedir($handle);
?>
---------------------
code to display file names below
---------------------
<?php
if ($handle = opendir('images/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$page_name=substr($file, 0, strpos($file, "."));
echo "$page_name
";
}
}
}
closedir($handle);
?>

The top PHP snippet displays images the bottom one displays their name now either of the following two methods is fine do you either know how to merge the two so the name is displayed uner the image no matter where they are. Or organise them into tables / div tags to position the name code under the image all ways.

Thanks for any help.

PS if your having a trouble understanding me Like Google but with just the image and its name no links
 
Back
Top