Dynamically generate content for images in folders using link <a> to php call

Within the WordPress environment, I am trying to automate the generation of dynamic HTML content to list a directory structure that contains thousands of image files and will provide a single directory listing for all directories at the top level. I have the top level directory listing working so that there are placeholders for links to all folders. I do not want to generate index files in every folder. The directory contents need to be treated as an external-owned repository that cannot be modified and that will change independently of the dynamically generated listings that automatically adjust to changes in the content of the repository. I would like to generate the listings of image files for each folder on the fly using the link to each folder from the top level directory listing. I have no problem to generate the content I need with a hard coded path inside the PHP. I am able to accomplish both sides of the problem, but cannot find a way to bind the top level listing page to the PHP that generates the list of images. I have tried to do it by passing the folder name through a URL, but when it gets inside the PHP, it does not allow read access to the folder, apparently because the PHP is called from the publicly visible URL. Is there another way that the PHP can be invoked so that content can be dynamically created on the backend by the user activating a link on the front end and then displayed? Is there a way a link can be encoded on the front end that does not cause this problem? Or should it be able to work the way I now have it configured?
I have not coded with jquery and if there is a way to do this with jquery or some javascript, I need an example to follow. Thanks.

Read more here: Dynamically generate content for images in folders using link <a> to php call

Leave a Reply

Your email address will not be published. Required fields are marked *