
November 1st, 2012, 07:51 AM
|
|
|
You can't, at least not directly. You are double clicking in a browser and PHP no longer knows anything about that page. Once the page is output PHP is gone. However, you can detect the double click with javascript and from there open a new window or tab that loads the double clicked file. Alternatively you could use Ajax to load the file but that may be overkill for what you want. Thirdly, you could also let the user select the file, click a button to submit it and then PHP can output the appropriate file.
As for loading all the file names from a directory, that is the easy part. Simply use 'readdir'.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.
Last edited by gw1500se : November 1st, 2012 at 07:53 AM.
|