Solved

last-modified for CGI-output...

Posted on 1997-12-10
6
220 Views
Last Modified: 2013-12-25
I would like a cgi-program to output have a static last-modified date.  In Navigator, the last-modified date can be seen by selecting view-page info from the menu.

I tried a meta tag as follows, with no luck:
<META name="Last Modified" content="Sat, 26-Aug-95 21:57:56 GMT">
 
The CGI-program prints out the entire-page of the resultant-html.  

The server I am using is Netscape Enterprise 3.0, on NT and Solaris.
             
I have heard about server-parsed HTML(SSI) for APACHE but do not know more about it myself.

Rollin Crittendon
0
Comment
Question by:rollin
6 Comments
 
LVL 1

Expert Comment

by:rets
Comment Utility
Do you want this CGI to be "the page" or an element in the page.  It appears that you'd like to have the last modified info be a part of the existing page is this correct?

Also, what server are you working with?

Are you allowed to have SSIs (server parsed HTML)?

There are several possible solutions.  Answering these questions will allow for a solution which fits your needs better.
0
 

Author Comment

by:rollin
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:phutson
Comment Utility
Why go through all of that how about a quick javascript.
just put this at the end of your page and it will do it.
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide script from old browsers.
document.writeln("LastModified: " + document.lastModified)
// End the hiding here. -->
</SCRIPT>
I tested this on netscape 3.01
and ie 3.02

0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Accepted Solution

by:
dagmar earned 50 total points
Comment Utility
At long as you resist the temptation to follow up your 'Content-type: text/html' line with TWO carriage returns, you should be able to do this with what amounts to this (using your dates from the example above) as the first part of your CGI output:

Content-type: text/html
Last-modified: 26-Aug-95 21:57:56 GMT
(blank line)

My guess is that you're trying to log/examine browser information (or kludge some quick Virtual Hosting) and avoid the ugly 'cache-busting' properties that CGIs tend to have.  I had to do the same thing myself, because my pages were driving the automated web agents some of my people were using berzerk...

Note:  HTTP protocol has very specific requirements as to what exactly a Last-modified date can look like, and the format above (if I'm not mistaken) is exactly it, up to and including you must specify times in the GMT time zone.  To convert your local time (if you're in the USA) to GMT, just:

add 5 hours for Eastern Time
add 6 hours for Central Time
add 7 hours for Mountain Time
add 8 hours for Pacific Time
0
 
LVL 1

Expert Comment

by:dagmar
Comment Utility
Oh, furthermore, you'll have a much easier task of converting the times to GMT accurately if you add hours*3600 to the mtime of the file in epoch seconds, and then convert the new epoch seconds into the required format...  
0
 

Author Comment

by:rollin
Comment Utility
Is there a way to get HTML-header information into a page if I write directly from a daemon-program at a port as well?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now