Question: Can I run a CGI script without returning a new page to the browser?
Answer: Yes, but think carefully first: How are your readers going to knowthat their "submit" has succeeded? They may hit 'submit' many times!The correct solution according to the HTTP specification is toreturn HTTP status code 204. As an NPH script, this would be: #!/bin/sh # do processing (or launch it as background job) echo "HTTP/1.0 204 No Change" echo
Yes, but think carefully first: How are your readers going to knowthat their "submit" has succeeded? They may hit 'submit' many times!The correct solution according to the HTTP specification is toreturn HTTP status code 204. As an NPH script, this would be: #!/bin/sh # do processing (or launch it as background job) echo "HTTP/1.0 204 No Change" echo Source: CoolInterview.com
Rules to Post Answers in CoolInterview.com:- There should not be any Spelling Mistakes. There should not be any Gramatical Errors. Answers must not contain any bad words. Answers should not be the repeat of same answer, already approved. Answer should be complete in itself.
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.