Cod-nes Posted August 27, 2008 Share Posted August 27, 2008 So here is my code: <?$path=dirname($_SERVER['REQUEST_URI']);$dir_handle = @opendir($path) or die("Unable to open $path");while ($file = readdir($dir_handle)) {if($read!='.' && $read!='..' && $read!='pass.php' && $read!='pageinfo.php' && $read!='edit.php' && $read!='change.php' $read!='title.html' && $read!='filesearch.php')echo "<a href=\"$file\">$file</a><br>";}?> The error I'm getting is Parse error: syntax error, unexpected T_VARIABLE in /aqua_news/filesearch.php on line 5 Link to comment Share on other sites More sharing options...
justsomeguy Posted August 27, 2008 Share Posted August 27, 2008 You're using the wrong variable name, use either $file or $read. The error message is because you missed a && in the if clause. Link to comment Share on other sites More sharing options...
Jesdisciple Posted August 27, 2008 Share Posted August 27, 2008 $read!='change.php' $read!='title.html' You need some ampersands. (I only found that by putting each condition on its own line.)EDIT: There he goes again... Link to comment Share on other sites More sharing options...
Cod-nes Posted August 27, 2008 Author Share Posted August 27, 2008 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.