Jump to content

How to make php read a folder:


ahsn

Recommended Posts

I can make php read a particular file with readfile() function when needed, but how do I make php read a folder of html files.

 

Because we know a full website has many html pages along with css files. I just want to load a site of many html pages when a condition is fulfilled ,i.e. after successful login.

 

Could anyone please tell me how do I do that?

Link to comment
https://forums.phpfreaks.com/topic/278564-how-to-make-php-read-a-folder/
Share on other sites

@requinix, thanks for help, but couldn't solve. If I run that code, it shows a empty page. 

But I have 3 html files and a css file linked to each other in a folder named 'dd' and I would like to make php show my complete site in browser when I run index.html file.

Is there a way to do that?

That alone won't do it. It doesn't even have a semicolon to end the statement, and if it did it still wouldn't do anything.

 

You have to write code. You can use that glob() thing in it but you still have to write a lot (relatively) more around it before anything will work.

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.