trying to display all images in a directory help!

  • scoyle7832
  • Born
  • Born
  • No Avatar
  • Joined: Sep 17, 2012
  • Posts: 1
  • Status: Offline

Post September 17th, 2012, 4:40 pm

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

$i++;

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>";


}

sort($files);

print_r($files);




?>

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!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 17th, 2012, 4:40 pm

  • jammer2552
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 23, 2006
  • Posts: 139
  • Status: Offline

Post October 6th, 2012, 10:36 am

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 102 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.