Automatic Form Submission to a CGI Program
|
|
|
|
| Articles Reviews CGI | |
| Written by Phil Harrison | |
| Friday, 09 February 2007 | |
|
{mos_sb_discuss:32} JavaScript can be used to automatically submit a form to a CGI program when a page is loaded. A CGI program will return data to the browser. If the CGI program returns a "204 No Content" status code to the browser, the browser should not change the current page. The script needs to be coded to return that status code specifically. Otherwise, the current page will change after the form is automatically submitted. (This may have the appearance of a redirector, and this automatic form submission method can in fact be used as such.) What the changed page is depends on what the CGI program sends back. If the CGI program will only log environment variables and/or set cookies, the form can be submitted without regular form data. If additional information is desired, it needs to be put into the form before submission occurs. Again, JavaScript comes to the rescue. Automatically Filling In Form Fields Any information that JavaScript can gather can be put into hidden form fields.
Powered by jReviews |
|
| Last Updated ( Sunday, 04 November 2007 ) | |
| < Prev | Next > |
|---|







