PHP Subpage Folder Call

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
brockf12
Forum Newbie
Posts: 2
Joined: Sun Aug 24, 2008 8:50 am

PHP Subpage Folder Call

Post by brockf12 »

I am creating a website that calls subpage names from the parent folder and displays them as links. I am using a content management system, but unfortunately it is not working properly.

What is the code for calling subpages from the parent folder? Possibly also showing the parent folder name?

I installed Wamp for developing websites and the default page automatically calls my project folders, this is exactly what I need. Those images are included.

I can't find or can't understand the PHP code. So, what is it?

Image

Image
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: PHP Subpage Folder Call

Post by jaoudestudios »

when you load http://locahost/ in your browser it uses apaches default settings to display the list of folders and files. This will not be available on a production server without modification and is NOT recommended as it is a security risk.

scandir is the php function you want to scan a directory for files and folders, this way you can control the users access and level.
brockf12
Forum Newbie
Posts: 2
Joined: Sun Aug 24, 2008 8:50 am

Re: PHP Subpage Folder Call

Post by brockf12 »

Thanks for the reply. I just want the PHP code for my operational server.

What specific scandir code would I use then for a very simple call?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: PHP Subpage Folder Call

Post by jaoudestudios »

Here is the details for the php function scandir...
http://uk3.php.net/scandir
Post Reply