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 6835807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:16:37+00:00 2026-05-26T23:16:37+00:00

Scenario :I am trying to build a Mobile Entertainment Portal. It will enable users

  • 0

Scenario :I am trying to build a Mobile Entertainment Portal. It will enable users to download Music & Movies to their Cell Phones…

Problem Exp : Suppose I upload 100 folders of Songs, each folder is for one Album. I want a way to generate a page with all the folders name (Album Name) in it. If user click on the page, they should be taken to a page where they get list of all songs in the album. Clicking on any song name will let them download it. Can it be done anyway or will I have to manually design each of the 3 pages for each album. If I do that, its time consuming and also will be difficult to change anything like footer, header…

  • 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-26T23:16:37+00:00Added an answer on May 26, 2026 at 11:16 pm

    First of all, this is a weighted question. But I will try to answer some of your questions to get you started.

    You can scan for directories using scandir() in PHP.

    $path = '/path/to/music';
    $dir  = scandir($path);
    if (is_array($dir)) {
        foreach ($dir as $directory) {
            if (is_dir("{$path}/{$directory}")) {
                // validate that it's among the directories you want
            }
        }
    }
    

    So, now that you know how to do that, perhaps instead of trying to create a separate page for each album folder you could use one script and based on the GET vars, display the appropriate content. e.g.

    domain.com/index.php?album=Album+Name
    

    Now let’s see how that might work with the above example:

    // assume your album folder names use underscores
    $album = (isset($_GET['album'])) 
        ? str_replace('+', '_', $_GET['album'])
        : null;
    $path  = '/path/to/music';
    $dir   = scandir($path);
    if (is_array($dir)) {
        foreach ($dir as $directory) {
            if (is_dir("{$path}/{$directory}") && $album == $directory) {
                // now, scan for files
            }
        }
    }
    

    Then to get the files, when you’re looping through the directories, instead of checking if it is a directory, check that it’s not a directory and that will give you your files. (e.g. if (!is_dir(...)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a service/API. In my scenario there will be a
Scenario : I'm currently trying to build a poor man's Google Maps using scripts
I'm learning Linq-to-Sql, and I'm encountering the scenario where I'm trying to build a
I am trying to build an SQL Statement for the following search scenario: I
I'm trying to build a query with hibernate criteria for the following scenario: Two
this is the scenario i'm trying to achieve: a sound stored on the same
I am trying to simulate a scenario where connection to the server of one
I'm trying to implement this scenario using Unity and i can't figure out how
I am trying to test a simple scenario in my development machine wherein I
I'm trying to design for the following scenario but cannot get my head around

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.