Solved

last-modified for CGI-output...

Posted on 1997-12-10
6
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:rets
ID: 1831607
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
ID: 1831608
Edited text of question
0
 
LVL 1

Expert Comment

by:phutson
ID: 1831609
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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
LVL 1

Accepted Solution

by:
dagmar earned 50 total points
ID: 1831610
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
ID: 1831611
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
ID: 1831612
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

623 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