DemonWulf Posted December 22, 2007 Share Posted December 22, 2007 What I am trying to do is dynamically create thumbnail hyperlinks on a gallery page based upon the names of Folders within a directory. Then, I want to be able to click each thumbnail generated and have each of them call a specific php file, but in addition, pass a variable, which is the name of the folder. Clicking the link, the php will generate a pop-up gallery template populated with images in a folder based upon the variable clicked. This is a step in the process of creating a dynamic gallery page with custom pop-up galleries. I am wanting to do this, so I can upload images / files into a folder, and have the code know what to do with it so I don't have to update my website myself, because I just don't have the time. I hope that got across what I am wanting / trying to do. The specific part I am hung up on is the generation / code of the dynamic hyperlinks, and with the example I have below, i was wondering if this is on the right track. Thank you for your help!! 1. Using php, grab all Names of Folders in a specific directory into an array. Array name = galleryArray 2. Create a For Loop that creates X number of hyperlinks to phpCode.php passing galleryArray. Link Example: <a href='phpCode.php?galleryArray"><img src="directory/galleryArray_tn.jpg" alt="galleryArray"/></a> Any help would be great since I am very new to PHP. Quote Link to comment https://forums.phpfreaks.com/topic/82841-dynamic-hyperlinks-and-passing-variables/ Share on other sites More sharing options...
tinker Posted December 22, 2007 Share Posted December 22, 2007 that sounds about right. 0ne thing though when parsing the links' returned variable, check that it is actually one of the specified files and not some other system file! Quote Link to comment https://forums.phpfreaks.com/topic/82841-dynamic-hyperlinks-and-passing-variables/#findComment-421335 Share on other sites More sharing options...
DemonWulf Posted December 22, 2007 Author Share Posted December 22, 2007 Well, I did add galleryArray"["i"]" (withought the quotes as I forgot about forum code). So, would something along those lines work for distinguishing which gallery page that these thumbnails would be opening? That was our major problem, having it all point to the same php file, but then know what content that the page needs to populate with. Quote Link to comment https://forums.phpfreaks.com/topic/82841-dynamic-hyperlinks-and-passing-variables/#findComment-421356 Share on other sites More sharing options...
DemonWulf Posted December 24, 2007 Author Share Posted December 24, 2007 Any other help or suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/82841-dynamic-hyperlinks-and-passing-variables/#findComment-422141 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.