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
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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.