Avatar of code_seekor
code_seekor
 asked on

Javascript or php to search directory and display file links on page

Hi,

I have a map that displays different airports, on clicking one of the airports (HTML pages) e.g ORD the user will be directed to a page with 5 tabs where each tab should display links to documents from a folder based on the airport they selected. Each tab displays certain documents related to the ORD. Essentially I would need to display links based on what tab is selected from a directory that can have subfolders specific to each airport and each tab.

<folder>ORD
       <sub-folder>Airport information (tab)
         info.pdf
         info2.pdf
       <sub-folder>Airport Development (tab 2)
         dev.pdf
         dev2.pdf
         dev3.pdf
         dev4.pdf

And so on...

I need to do this dynamically so that I don’t have to create or remove a link each time a new document is added or removed to a folder.

I am completely new at setting up anything like this. A specific explanation of what pages or scripts needed to be created and where scripts should be placed would be extremely helpful.

Any help or suggestions on doing this would be highly appreciated!
Thanks
JavaScriptScripting LanguagesPHP

Avatar of undefined
Last Comment
code_seekor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
EMB01

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
code_seekor

ASKER
Thank you so much! I haven't had a chance to implement this yet but will do so and let you guys know how it worked!

Thanks again!
code_seekor

ASKER
How does my reports page which has the tabs under which these files will be displayed and link, know to read from the php file that we created? Thanks!
EMB01

You can put the script inside of your reports page.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Ray Paseur

There may be a long learning curve to get from where you are to where you want to go.  I recommend this book as one essential part of the "getting started" process.
http://www.sitepoint.com/books/phpmysql5/

Best of luck with your project! ~Ray
code_seekor

ASKER
Thank you!!