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

How to require a re-post from the visitor

Status
Not open for further replies.

SFBassman

Programmer
Jan 15, 2003
3
US
I want to require visitors to post data each time they want to visit a certain page (one that is created by a CGI script.) I have visited pages that have stated "Page has expired", or "You must re-post data in order to continue".
How would I accomplish this without using SSI?

Wouldn't the test for new data have to be written into
the dynamically generated page?
 
Actually, you can get the results you'd like by setting the header information for the page for expirations and caching to expire immediately. Something like the following:

Code:
print header(	-type => 'text/html',
		-cache_control => 'no-cache',
		-expires => '-1d',
		-nph);

The line [font color=red]-expires => '-1d',[/font] has some information that you'll need to be aware of.
[ul]
[li]d stands for days, you can substitute this with m for minutes.[/li]
[li]The number listed shows how long the page will stay in memory on the client machine. Placing a negative number here will make the page expire immediately[/li]
[/ul]

Hope this helps!
- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top