Ok I am making a sorta of simple forum that I am going to submit as a tutorial on these forums but I can't figure out how two open to directory's at the same time so that two content variables will work in one echo see my code for what I meen:
So ya if you anything about php you should what I am trying to accomplish here.
But I get this error message when I run the script and I know why but I can't figure out how to fix it so it works the way I intended.
Thanks.
| Code: |
|
<?php // path to the folder listed - can be full path //$path = "/var/www/html/"; //or relative path $path = "Category"; // Open the folder for display $dir_handle = @opendir($path) or exit("Unable to open $path"); // Loop through the files while ($folder = readdir($dir_handle)) { // do not display current file if($folder === ".") continue; if($folder === "..") continue; // Display file links $path1 = "Category/$file" $dir_handle1 = @opendir($path1) or exit("Unable to open $path1"); while {$folder1 = readdir($dir_handle1)) { // do not display current file if($folder1 === ".") continue; if($folder1 === "..") continue; echo "<table width=\"98%\" border=\"0\"><tr><td height=\"24\" background=\"Images/top1.PNG\" align=\"center\" style=\"border:1px #000000 solid\"><div align=\"center\"><font face=\"Arial, Helvetica, sans-serif\" ><b>$folder</b></font></div></td></tr></table><br>$folder1<br>"; ) } // Close directory closedir($dir_handle1); closedir($dir_handle); ?> |
So ya if you anything about php you should what I am trying to accomplish here.
But I get this error message when I run the script and I know why but I can't figure out how to fix it so it works the way I intended.
| Quote: |
|
Parse error: syntax error, unexpected T_VARIABLE in /home/cr3ativ3/domains/oyoystudios.frih.net/public_html/Forum/ftemplate.php on line 20 |
Thanks.
