In addition to the Send to File/E-mail handler and the Send to Database handler, FrontPage also allows you to connect a form to your own custom designed form handler via the Send to Other option on the Form Properties dialog box. When you select the Send to Other option, the dropdown next to it becomes active. The dropdown contains three choices:
The first option, Custom ISAPI, NSAPI, CGI, or ASP Script, allows you to create your own form handler and point the form to it. Development of ISAPI filters, NSAPI, and CGI components is beyond the scope of this book. Instead, we will create a simple form handler using ASP. NOTE For more information on ISAPI filters, read Internet Information Services Administration from Que Publishing. For more information on NSAPI, see Netscape Communications's NSAPI Programmer's Guide at http://nsapi.frontpagelink.com. For more information on common gateway interface, or CGI, read Special Edition Using CGI. For more information on ASP, read Active Server Pages 3.0 From Scratch from Que Publishing. The form handler you will build here is not a robust solution, but is meant to show you the framework provided for creating a custom ASP form handler. You will use the comment.htm page that you have been using throughout this chapter. You will need to create a new ASP page to handle your form:
You will configure this page so that it will display the information that was entered in the form on comment.htm. Start by creating the ASP code necessary to display the values from the form fields:
The handle.asp now contains ASP code that will display the values of the form fields txtName and txtComments. It does this using the Response.Write statement, which writes information to the browser window, and the Request.Form collection, which contains one item for each form field. Now you simply need to point comment.htm to the new ASP page:
Now save your page and browse to comment.htm. Enter your information and click Submit, and handle.asp should appear with the values you entered in the form. |