note 29350 deleted from ref.dir by didou
| From: | didou@php.net | Date: | Thu, 29 May 2003 22:20:48 +0000 |
| Subject: | note 29350 deleted from ref.dir by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49350@lists.php.net to get a copy of this message | ||
Note Submitter: tlsprwr@hotmail.com
----
About jmb at writeme dot com's directory file listing script:
If you change the $path variable to anything other than ".", you will probably receive
errors in the file link, size, and date.
What's happening is it's trying to access "/file.ext" instead of
"/path/file.ext".
The way I have corrected this is replacing where it says the following:
$t="<a href=$file>$file</a>";
...
$t=(filesize($file)/1024);
...
$t=date("d.M Y H:i:s", filemtime($file));
and the like (if you modified it), with this:
$t="<a href=$path/$file>$file</a>";
...
$t=(filesize($path/$file)/1024);
...
$t=date("d.M Y H:i:s", filemtime($path/$file));
This may give some errors if the path is ".", but I haven't tried it. You may want to
do some if statements to correct it if it is set to view "." directory, depending on what
you're using the script for.