On Sat, Jan 01, 2011 at 07:14:19PM +0000, Chris G wrote:
I want to implement a link to a CGI script that, when you click on it, does nothing to the currently displayed page. I.e. I want the existing page to continue to be displayed when I click on the link (and as a result of course the CGI script executes).
Actually even more perfect *might* be to force a redisplay of the current page as the CGI script will (hopefully) modify the page.
This sounds as if it must be something one often wants to do but being naive as regards HTML/CGI I don't know how to do it.
Well the answer is (or at least the simple one I have found) is to use the "Location:" HTTP header field.
All that's needed is for the (bash) CGI script to do:-
echo "Location: "<Absolute URI for page>
and when the CGI script exits (if the above is at the end) then the page specified gets displayed. Apparently even though the specification is that it should be an absolute URI a relative one works in most browsers.
All I want to do now is wind up the server timeout so that it doesn't matter how long the CGI script takes (it's me editing things).