Last but one update

I am looking for the script (Java) to print the last but one modification date of a file.

Using  the script:

<SCRIPT LANGUAGE="JavaScript">
<!--- Hide script from old browsers.
document.writeln("LastUpdated: " + document.lastModified)
// End the hiding here. -->
</SCRIPT>

to get the last modification date work fine. But how can I get this script to return the previous modification date of the file.

Please help!
EricKAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
How are you using it?
is it inside of a
print <<"ENDPRINT";
....
ENDPRINT
?

print scalar localtime ((stat "property.db")[9]);
should be just a statement executed by perl.
0
 
EricKAuthor Commented:
Edited text of question.
0
 
EricKAuthor Commented:
The reason I need this is as follows:

I have a cgi (perl) script file which returns the list of records in the database as html table format. In the same script there is also add & delete record (to database) facility.

When I include the LastModified script (as above) within the table tags I get the date printed on the displayed list. However, as the table is created by the cgi script, everytime the list page is called (from its link) the the Last Modified script assumes it to be updated.

I only want it to be updated when either the delete or the add options are used. So when the list is called without add or delete event occuring
I need the script to return the previous modification date( in other words no change in the last modified date)

Here is corresponding part of the cgi:

sub PrintTOP

{      my($text)      =      @_;

      print <<"ENDPRINT";

<HTML>

<HEAD>

<TITLE></TITLE>

</HEAD>

<BODY BGCOLOR="#408080" TEXT="#000000" LINK="black" VLINK="black" ALINK="black" LEFTMARGIN="1" TOPMARGIN="0">

<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%">



<TR>

<TD VALIGN=TOP ALIGN=LEFT>



<FONT FACE="ARIAL" SIZE="4">$text&nbsp;</FONT>

</TD>

</TR>
<TD VALIGN=TOP ALIGN=RIGHT>
<H4 STYLE="color: #FFFF00"><SCRIPT LANGUAGE="JavaScript">
<!--- Hide script from old browsers.
document.writeln("LastUpdated: " + document.lastModified)
// End the hiding here. -->
</SCRIPT></H4>
</TD>
<TR>

<TD BGCOLOR="#999966" VALIGN=CENTER WIDTH="100%">

<FONT FACE="ARIAL" SIZE="2">

ENDPRINT  

etc


I want to be able to add the folowing:

if($action ne "add")

{

print <<"ENDPRINT";

date of previous update
ENDPRINT

}
else
if($action ne "delete")

{

print <<"ENDPRINT";

date of previous update
ENDPRINT

}

else
new update
{



ENDPRINT

}


How can I do this.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ozoCommented:
can you save the old modified date before you add or delete?
0
 
EricKAuthor Commented:
To: ozo

Please assume I am totally ignorant at script matters. Infact I am very new to this.

Please can you help me with the code
(java or cgi) for saving the old modified date.

Then I suppose I will have to update this document whenever add or delete options are called.

But how?
Thanks
0
 
ozoCommented:
Where in your script do you do the update?
0
 
EricKAuthor Commented:
To ozo

I've just realised that I am complicating the issue here.

All I need is to print the lastmodified date of my database file.

I tried:

print scalar localtime ((stat "/property.db")[9]);
(where property.db is my database file in the same directory)
in the cgi  script page but it just returns the text.

What is the best way of doing this.

is there an easy way to do this with ssi?

I have taken alot of your time. So am increasing the points to 100

please help
0
 
ozoCommented:
print scalar localtime ((stat "/property.db")[9]);
I'm not sure you want the / there, but what did you want it to do other than just return the text representation of the last modified date?
0
 
EricKAuthor Commented:
No. What I mean is it just returns the script text:

ie: print scalar localtime......etc

and not the last modified date.
0
 
EricKAuthor Commented:
Thanks ozo

I tried this and there is nothing wrong with it under normal circumstances.

So I will release the 100 points.


However: Due to the script I am using for generating the database records list,
everytime the user calls for that list the a new update operation is performed.
Hence: the last updated date is always the date someone last clicked the two
list options ("accomodation to let" or "property for sale")on the menu
of the homepage.

I only want the update date to change if an "add" or "delete" action is
performed by the site owner.

I will offer another 100 points if you can have a look at the script file
and find a solution for this.

the name(url) of the script file is: cgi-bin/property#

the url of the home page is: http://www.homefinders-uk.com

NB: How do I attach the script file
cgi-bin/property to the question?
0
 
EricKAuthor Commented:
Please see the new question
0
 
ozoCommented:
0
 
EricKAuthor Commented:
I am sorry. No permission to the cgi-bin folder.

I have just copied the property file to root directory.

http://www.homefinders-uk.com/property

0
All Courses

From novice to tech pro — start learning today.