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

  • Home
  • SEARCH
  • 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 7847813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:00:38+00:00 2026-06-02T18:00:38+00:00

I use php files in my website and in those file I include my

  • 0

I use php files in my website and in those file I include my html to show whatever i want the user to view. However i’ve ran into a problem. I need to show a list of available downloads from a specific folder from my website. The uploading downloadables from my website works. The reading files from directory works, this is done using php code. Now the thing is how can I show this in my html, how to I show this to my user in a fashion that i like most, like for example how Dropbox shows their file listing something like that.

The thing is to pass those files found within the PHP file and pass them to the html to be able to work with them however I want.

I hope i am clear, in case please just tell me so I can elaborate more.

Thanks.

Some code as requested, this is how I am supposedly extracting my files from my website’s directory…

Ahh something like this, i get the idea, but here is my problem…

my code looks like this…

$directory_mine;


    if ($directory_mine = opendir('/path/to/files')) {
//This is for testing.
echo "Directory: ". $directory_mine . "\n";
echo "Entries:\n";

while (false !== ($entry = readdir($directory_mine))) {

    //should be writing each file name into the html here. at least thats my thinking.

}

closedir($directory_mine);
    }
    include("overall_header.html");
    include("mobiledownloadview.html");
    include("overall_footer.html");

See here is the problem, how can i add the data extracted by my php file to the mobiledownloadview.html???
I believe this is one way to do it, but if this is terrible please tell me. is there a better way to acomplish my goal?

  • 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-06-02T18:00:39+00:00Added an answer on June 2, 2026 at 6:00 pm

    From the manual on readdir:

    <?php
    
    if ($handle = opendir('/path/to/files')) {
        echo "Directory handle: $handle\n";
        echo "Entries:\n";
    
        /* This is the correct way to loop over the directory. */
        while (false !== ($entry = readdir($handle))) {
            echo "$entry\n";
        }
    
        /* This is the WRONG way to loop over the directory. */
        while ($entry = readdir($handle)) {
            echo "$entry\n";
        }
    
        closedir($handle);
    }
    ?>
    

    If you want to style it, wrap it in an (un-) ordered list and use css for that.

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

Sidebar

Related Questions

My website is built using php files. I use trade secret algorithms in these
I use the PHP language for file upload and want to know that the
I was following this tutorial . I need to use a php file's ouput
Is it possible to use php to search a string for a file path
I would like to change this: // use appropiate lang.xx.php file according to the
Is it possible to restrict direct access to PHP file if I use jquery
I am learning php, trying to use the fopen() function. The php file I
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I use mercurial for php projects and my .hgignore file is not working. It's
In php we use includes. So variables defined in one file and then their

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.