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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the Directory Last-Updated Date n display in webpage

Status
Not open for further replies.

coolseth

MIS
May 8, 2003
5
US
Hey all...

I want to know if there is possible solution for the thing I want to do (if there is any) [ponder]

I usually upload a couple of folders (with some files in them) to my web directory and I usually edit my page n save it again so that the script language I use will display the "Last Updated on" of my web page.

What I want to do is to get the information on the date that web directory is last updated (i.e the last time I uploaded the files/folders) and display it to my webpage without having to edit (n save) my web page which I am doing right now (i.e Javascript etc)

Is there easy way for doing it? or do I have to it old fashion way using the script. Any suggestion is welcomed

thanks...
 
A simple script:

<html>
<script language=&quot;Javascript&quot;>
function mod(){
document.write(document.lastModified);
}
</script>
<body onload=&quot;mod()&quot;>
</body>
</html>

Don't eat yellow snow!
 
From what I gather, it seems you use a web based service to host your site, and you dont have your own server? With this type of service, I dont know if the provider gives you the rights to get that kind of information, but I could be completely wrong. I am pretty sure though, if you have your ran your own server, that would be cake to find out (especially in linux.... :))
 
thanks for your replies...

quasibobo: does ur script work to display the last-updated info for the directory/folder in other folder?? i tried it on my web page...but it only display the last-updated date for my page

dillpick6: looks like you have what i want there...i can access it to upload my files (sure i dont own the server myself, but does it mean i have access to my server) but since i do not know much about technical details of this stuff...i would be glad if you can give me some information on how to do it, such as:
- how to get the infomation from the server (with my FTP software i can see info on &quot;Date Modified&quot; for all of my files)
- do i need specific code (program) in specific language to get that information (some examples will help)
- how to automatically display that information on my web page without having to update my web page code

thanks again...

 
If you're able to write CGI programs on your server, it'd be pretty straightforward to write a script in, say, perl to do what you want. You could then access it through a SSI.

However, I don't think there's a way to do it from the client - webservers tend to be configured to to give out directory information.

-- Chris Hunt
Extra Connections Ltd
 
hey guys...

thank you for your generous responds...i finally able to solve the problem using PHP. here is the code i use:

<?php
$getLastModDir = filemtime(&quot;path/to/directory_name/.&quot;);
print (&quot;As of &quot; . date(&quot;F d, Y H:i:s A&quot;, $getLastModDir));
?>

where the dot at the end of the directory's path to treat the directory as a file

hope it can be useful for u guys...

for more information on that you might want to go to this site:


seth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top