thesecraftonlymultiply Posted April 22, 2008 Share Posted April 22, 2008 Hi there! Hope everyone is well. I am in need of some further help if you do not mind. I am using this code: <?php $handle = opendir ('./thumbnails/'); while (false !== ($file = readdir($handle))) { if($file != "." && $file != ".." && $file != basename(__FILE__)) { echo '<img src="./thumbnails/'.$file.'">'; } } ?> to output the images of the thumbnails directory... I am struggling to include the link for each thumbnail as: "./uploadedimages/'.$file.'" I am getting very confused amongst all the single and double quotation marks! That is my first question if anyone would be kind enough to help me? Secondly I would like to style the images with CSS, how is this possible? Do I just wrap a div id around the echo statement? Thankyou very much in advance Best wishes, Luke Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 22, 2008 Share Posted April 22, 2008 <?php $handle = opendir ('./thumbnails/'); while (false !== ($file = readdir($handle))) { if($file != "." && $file != ".." && $file != basename(__FILE__)) { print "<img src='./thumbnails/{$file}'>"; } } ?> Quote Link to comment Share on other sites More sharing options...
thesecraftonlymultiply Posted April 22, 2008 Author Share Posted April 22, 2008 Thankyou! The line now reads: print "<a href='./uploadedimages/{$file}'> <img src='./thumbnails/{$file}'></a>"; ...and it works perfectly. Now how do I go about laying out the images appropriately? Can I place them either within a simple table or style them with CSS? Many thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.