Jump to content

Loop through a folder containing HTM files


gibbo1715

Recommended Posts

All

 

Im new to php but am keen to learn

 

What i want to do is the same as an image gallery but using htm files

 

I have figured out from looking on the web how to display my files with a link to them as follows

 

<?php 
$handle = opendir('.'); 
while (false !== ($file = readdir($handle))) { 
if ($file != "." && $file != "..") { 
echo "<a href=\"$file\">$file</a><br>"; 
} 
}
closedir($handle); 
?>

 

Can anyone point me to something that shows me how to display the actual html page with prev next buttons and show the contents of my dir one htm page at a time

 

thanks

 

gibbo

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.