Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6560687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:33+00:00 2026-05-25T13:29:33+00:00

I am creating a CMS application as an addition to a website of mine.

  • 0

I am creating a CMS application as an addition to a website of mine.

On this website, there is a promotions section.

I want to make a page that lets me easily add and edit promotions (2 images).

Ideally, this page would let me create and edit folders that are stored within a specific folder on my server. I could then upload images to the relavant folders. The folders that house the images would be called something like “sept-oct”.

I already have a blank page that can only be seen once I have logged on as the website administrator account. Now to fill that page.

I am slightly aware of the ability of php, when it comes to creating code that creates directories, or creating and editing files.

Can anyone provide me with some suggestions, links to tutorials, peices of code or tips that would cover this area of php?

My main question though, is how would I list the promotion folders stored in the main promotions folder? Something like drawing out rows of mysql data and displaying them in a loop.

With that I could begin to add new folders or edit existing ones.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:29:33+00:00Added an answer on May 25, 2026 at 1:29 pm

    One basic way is to use the glob() function.

    $dirs = glob('path/to/promotions/folder/*', GLOB_ONLYDIR);
    foreach ($dirs as $dir) {
        $name = basename($dir);
        echo $name . PHP_EOL;
    }
    

    There are several other great tools available for looping over filesystem contents, including scandir() and FilesystemIterator. These latter two would usually need some filtering to only work with the directories.

    $iterator = new FilesystemIterator('path/to/promotions/folder');
    foreach ($iterator as $fileinfo) {
        if ($fileinfo->isDir() {
            echo $fileinfo->getFilename() . PHP_EOL;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a basic CMS website using Alfresco Web Quick Start. I want
Creating a one page site want a really light weight CMS. I usually use
We're creating a page in Orchard CMS using the 'List' Content Type. We want
I want to use some ASP.NET based CMS for creating my website and don't
When creating say a cms application where website specific details will vary depending on
Hello I am creating a CMS and some of the functionality of it that
I am creating a CMS and want to know if its possible to download
I'm creating a CMS, and want all request sent to Default.aspx except for the
I'm creating a CMS, and I want to dynamically load the style from the
I'm creating a PHP CMS, one that I hope will be used by the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.