Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display modification date of XLS file on server

Status
Not open for further replies.

njitter

Technical User
Sep 4, 2001
122
US
Hi,

i would like to create a page that links to a XLS file on the webserver.

I would like to show the modification date of the XLS file on this page. Something like this:

file.xls (last modified at 1 januari 2005).

I think i will have to use PHP to get this modification date. Could someone please point me in the right direction?

Kind regards,

Njit

---
It's never too late to do the Right thing
 
this is not a problem..

1: take a dirlist script
Code:
<?php 
if ($handle = opendir('.')) {
   while (false !== ($file = readdir($handle))) { 
       if ($file != "." && $file != "..") { 
           echo "$file\n"; 
       } 
   }
   closedir($handle); 
}
?>

2. modify it to show only xls
3. Use to get "last modified" date
4. modify script to generate links

Code:
echo "<a href=\"$file\">$file</a>\n";


remember:
Note: The results of this function are cached. See clearstatcache() for more details.

Even if you are a beginner, this takes less than 10 minutes.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top