Re: Refresh help
"Alexander J. Oss" <[email protected]> Sat, 2 Nov 2002 06:15:44 -0500
| Newsgroups | gmane.comp.gcc.cgicc.general |
|---|---|
| Message-ID | <002201c28261$30704d60$0101a8c0@puter> |
I use the following technique all the time at work: 1. User submits a form to a CGI application. 2. CGI application creates an HTML file that essentially says "your process is starting", and which has a refresh META tag. 3. CGI application spawns a long-running subprocess which will periodically overwrite that same HTML file (also with refresh META tags). 4. CGI application returns a Location: header redirecting the user to the HTML file, instead of returning HTML itself. This causes the user to see nothing but the status HTML page which refreshes itself periodically. I think the same technique would probably work for you. The only difficulty with the technique appears to be when the subprocess writes the status page at the same time the web server process tries to read it, but this is rare. I'm quite proud of and familiar with this, so if you have any questions, feel free to ask. (This isn't so much a cgicc issue as it is a general CGI usage issue, so it's your discretion as to whether the help-cgicc list is the proper forum for the discussion. I myself like to see CGI usage discussions here, though.) Hope that helps! ----- Original Message ----- From: "Quintin Connell" <[email protected]> To: <[email protected]> Sent: Friday, November 01, 2002 6:15 AM Subject: [help-cgicc] Refresh help Hi, I have a cgicc application and the user submits a POST request which does a write to a database and on successful completion a status page is displayed. If a user now clicks on the Refresh button on their browser they get the following message - The page cannot be refreshed without resending the information. Click Retry. If they do the information is resent and a duplicate now appears in the database. Is there any around this to avoid creating duplicates? To make the status page appear that it was obtained by a GET request, for example? So that Refresh requests will only redisplay that page. Because users do need to refresh the status page. TIA Quintin _______________________________________________ help-cgicc mailing list [email protected] http://mail.gnu.org/mailman/listinfo/help-cgicc