Using Custom Scripts with Forms


FrontPage s built-in form handlers are sufficient for most simple forms. But to create forms that return catalog Web pages, or detailed information about the type of browser and connection the visitor is using, or other post-submission processing, there s no subsitute for a custom script. Custom scripts open a two-way communications channel with your visitors , providing a response when searches are made, or when someone logs in to a restricted area of your Web site.

Traditionally, custom scripting is performed by experienced computer programmers. But you may not need to hire someone or learn a programming language to make use of a custom script. Plenty of ready-to-use scripts can be found on the Internet, and often you can find prewritten programs to meet your business needs.

Lingo  

A custom script that processes form data is an external computer program that is designed to accept the information entered into a form s date-entry fields and process them. Such a program is likely to take the form of a Common Gateway Interface (CGI) script or Active Server Pages (ASPs).

While it s beyond the scope of this book to discuss how to create a custom script from scratch, FrontPage does make it easy to associate a custom script with a form that you have designed. Just follow these steps:

  1. Right-click anywhere within the form, then choose Form Properties.

  2. When the Form Properties dialog box appears, click Send To Other, and choose Custom ISAPI, NSAPI, CGI, or ASP Script from the drop-down list.

  3. Click Options. When the Options For Custom Form Handler dialog box appears (see Figure 15-7), enter options for the Action, Method, and Encoding Type Fields:

    • Action specifies the action that you want the custom script to perform when form data is submitted by the user . You can specify a URL leading to a custom script, so the data can be processed by it (for example, an absolute path leading to the script might be: http://www.myfrontpageweb2.com/cgi-bin/inquiry.pl . A relative path might be ../inquiry.pl ). You can also send the data to an e-mail address using the mailto action (for example, mailto:account@myfrontpageweb2.com ).

    • Method describes the way the form will submit data to the server. The two options are GET and POST. POST is the preferred method, used by FrontPage by default. POST transmits data in a separate stream to the custom script or form handler. GET adds the data to the URL of the custom script; the number of characters you can send using GET is limited to 4096, and you should only use GET with forms that are certain to solicit only a small amount of data.

    • Encoding Type specifies the Multipurpose Internet Mail Extensions (MIME) content type used for encoding the form data before it is passed tothe server. Form data needs to be encoded so that data input fields can be matched to key values. When you use a custom script, you don t have to set a value in the Encoding Type field, but you could use the default value x-www-form-urlencoded .

      click to expand
      Figure 15-7: if you have a custom script available to process form results, use these options to specify how the script should work.

Lingo  

MIME stands for Multipurpose Internet Mail Extensions , a standard way of designating file types so that they can be processed by browsers, other applications ”or in this case, custom scripts.




Faster Smarter Microsoft Office FrontPage 2003
Faster Smarter Microsoft Office FrontPage 2003
ISBN: 0735619727
EAN: 2147483647
Year: 2004
Pages: 179

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net