|
[PHP-INSTALL] Error trying to list images in a directory: msg#00079php.install
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"; ?> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [PHP-INSTALL] mb string install problems: 00079, Erin D. Hughes |
|---|---|
| Next by Date: | Re: [PHP-INSTALL] Error trying to list images in a directory: 00079, Frank Bax |
| Previous by Thread: | [PHP-INSTALL] mb string install problemsi: 00079, Erin D. Hughes |
| Next by Thread: | Re: [PHP-INSTALL] Error trying to list images in a directory: 00079, Frank Bax |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |