trying to display all images in a directory help!

  • scoyle7832
  • Born
  • Born
  • scoyle7832
  • Posts: 1

Post 3+ Months Ago

$dir = "templates/basic/data1/images/";
$handle = opendir($dir');
while($file = readdir($handle)){
if($file !== '.' && $file !== '..'){


echo "<li><img src='templates/basic/data1/images/".$file."' alt='Portfolio Interiors Kamloops Furniture Store' title='Portfolio Interiors Kamloops Furniture Store' id='wows".$i."'/></li>";





Here's my code above, not sure where the issue is, but now I'm getting an "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/blackw/public_html/store/test.php on line 9"

Seriously confused any help is appreciated!
  • jammer2552
  • Graduate
  • Graduate
  • User avatar
  • Posts: 139

Post 3+ Months Ago

On line 3 ($handle = opendir($dir');), you have an extraneous apostrophe.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 26 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.