Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Error trying to list images in a directory
While trying to learn Php/MySQL from "Php 5/MySQL Programming for the
absolute beginner" book, I copied the exact code and yet ran into error
saying:

"Parse error: syntax error, unexpected $end in C:\Program Files\Apache
Group\Apache2\htdocs\Calendar\Two\test.php on line 41"

Line 41 is a line AFTER </html>

I might be missing something?


<?
$dirName = "C:\Program Files\Apache
 Group\Apache2\htdocs\Calendar\Two\Images
";
$dp = opendir($dirname);
chdir($dirName);

while($currFile !== false){
$currFile=readDir($dp);
$thefiles[]=$currentfile;
}

$imageFiles=preg_grep("/jpg$|gif$/", $thefiles);

$output = "";
foreach($imagefiles as $currentFile){
$output .= <<<HERE
<a href=$currentfile><img src="$currentfile"></a>
HERE;
}

$fp = fopen("imageindex.html","w");
fputs ($fp, $output);
fclose($fp);
print "<a href=$dirname/imageindex.html></a>\n";

?>

Report this thread to moderator Post Follow-up to this message
Old Post
Scott Hamm
10-20-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Installation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:27 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.