[help] dynamic php page w/links

What I am trying to do is have a php or other dynamic page that automatically builds links to a specified folder(s) in my subdomain at seph.ws.

For example, say I upload Vitamin_water.mov, to http://mu.seph.ws/random/....

the page, http://mu.seph.ws/dynamic.php would automatically build a link to that via a script or something, similarly when I delete Vitamin_water.mov the script would remove the link as well. MT does something similar with its archives page, which places a link to the entry etc. Does such a script exist? One that automatically scours a folder for files and then places them on the page? I'd rather not use the default file listing page for various reasons.

Post Scriptum: No one dare thank this thread, or I'll have Seph-in spiritus-hunt you down ;)

#274120

You could google for a way to read directory listings with php (it is possible, but a bit slow). This way you can upload via any method and still get a listing

Or, make a file upload form. The downside to this is that you have to use the webpage to add files. If you want to do it this way I can paste some code to get you started.

#274122

You could google for a way to read directory listings with php (it is possible, but a bit slow). This way you can upload via any method and still get a listing

Or, make a file upload form. The downside to this is that you have to use the webpage to add files. If you want to do it this way I can paste some code to get you started.

I'd rather not resort to using a web form >.<, as I find such methods to occasionally freeze when uploading large files. I keep googling/hitting php sites/forums for a snippet of code, but either all examples provide no code (i.e. only the page with the indexer at work) or I get a parse error on the ones that do provide php code. Thanks for the input though Ludge, I was just wondering if there was perhaps an easy way to implement this, but if you say its going to prove slow..then its not worth it.

PS: shame you can't thank your own threads

#274124

I think i have something that might work, but it's pretty late for me... but if you found a file directory script and a cache script you could do it that way.

The script would check and list all the files in a directory and then check if those are new files. If it is, it builds the page saves it as a static file, and if not it loads the static page. That takes a huge load off the server.

#274126

I think i have something that might work, but it's pretty late for me... but if you found a file directory script and a cache script you could do it that way.

The script would check and list all the files in a directory and then check if those are new files. If it is, it builds the page saves it as a static file, and if not it loads the static page. That takes a huge load off the server.

That wouldn't make much difference. The slow bit in building a page like that is checking whether the files exist and/or have been modified. For this reason PHP caches this data. Hence you making a cache of your own would be pretty pointless.

#274130

Idealy, I'd like to run a php script that would update a specified php (styled with an external CSS, dont know if that makes a difference or not) page, (must in the same way that a php script builds thumbnails for a gallery then updates the gallery) that way I don't have to worry about it checking every 2days and using up bandwith.

It is much easier (for me) to bookmark the phpscript, then run that instead of editing the html by hand then uploading to my server. It isn't important, since this isn't for work or anything I just wanted to save myself some time, since I am extremely lazy.

#274134

The Script Roxtar mentioned sounds interesting... WANT IT TOO ;-)

#274142