Parse error: syntax error, unexpected ';' in

Hello,

Having a bit of an issue and can’t seem to figure out why. This is prob a stupid question but it is sort of bugging the crap out of me :frowning: not sure what i am missing…

Any help would be greatly appreciated!!

Getting error:
Parse error: syntax error, unexpected ‘;’ in /home/content/01/8496801/html/add.php on line 60

*i marked line 60 in red

CODE:

				<?php
				if ($handle = opendir('../upload/images')) {
				    while (false !== ($file = readdir($handle))) {

-line 60 if ($file != “.” && $file != “…”) {
?> <? echo "$file\n "; ?> <?
}
}
closedir($handle);
}

				?>
				</select>

Thank you!! :slight_smile:
e

Rather than searching for the amazing missing semi-colon, allow me to suggest an alternate means of accomplishing your goal:

[php]

<?php $files = glob('../upload/images/*'); foreach($files as $f){ if($f != '.' && $f != '..') echo("$f"); } ?>

[/php]

It’s a little bit cleaner, doesn’t have all the interpolation you’re using, and the glob() function gives you an easy way to do pattern matching against directory entries, so I think it’s probably more what you’re after. Read up on glob() here: http://php.net/manual/en/function.glob.php

Sponsor our Newsletter | Privacy Policy | Terms of Service