I have made a form that I would like to submit certain information. I set it up to it emails all the info to a certain email address. Now that all works perfectly. What I need to find out is how to install a cgi script on my web server so that I can designate what page the user is sent to depending on wether the information is correct or not. I would like a "Info sent" page and a "Error w/ info" page. Any help is greatly appreciated. Thank you...
If I follow your question, Brad, you'd probably be wisest to do this within the mailing script itself -- rather than with some separate means of redirection.
In brief, upon accepting the form information, evaluate it as correct or in error, and redirect to different pages based on the evaluation.
However, I'd really suggest rolling this all in CGI, as the scripting would actually be easier, more flexible, and more reliable.
[Edited by etLux on 11-17-2000 at 04:13 PM]
You can set a form's action conditionally as follows:
var isOk = true;
....validation checks....if fail, isOk = false...
formObj.action = (isOk) ? 'goodpage.html' : 'badpage.html';
You only need to omit the 'action' attribute from the form tags and check the fields upon submission (either through onSubmit or onClick, dependent upon whether you are using a submit or regular button).
If this is not what you are looking for, I will move this thread to the server-side forum.