|
|
|
|
|
The first step in allowing users to publish articles on your Web server is to create an HTML form in which authors will enter information. Creating HTML forms that allow user input is relatively straightforward and the process is well documented in many places on the Web. The entry form described in this section is what the user will use to publish a new article. Every form will have "input fields" into which users will enter data, and with NetForms you can use any field type supported in the HTML standard. Each input field, whether it is a single-line text entry field, a check box, or a radio button, will have a "field name" with which it is associated by NetForms. Be sure to name your input fields with names you can easily remember, since you will refer to them by name when you create NetForms FDML documents. In HTML, what
appears on a web page is defined by special sequences of
characters called "tags". All HTML tags begin with a
less-than character (<) and end with a greater-than
character (>). HTML tags contain a command word and may
also contain other words, called "attributes," which provide
additional information about the command. The FORM Tag An HTML form is defined by a beginning <FORM> tag and an ending </FORM> tag. In between these form tags are various <INPUT> tags which define the look and behavior of the "input fields" in the form. Every <FORM> tag used with NetForms must have at least two attributes:
The ACTION Attribute To specify NetForms as the application that will "take action" on the input data once it has been transmitted to the server, you must specify an ACTION attribute in the FORM tag. In the ACTION attribute, simply give the URL to the NetForms application, followed by a dollar sign ("$"), followed by the path to the FDML file to be used to process the data. For example: <FORM ACTION="/NetForms.acgi$/MyFDML.fdml" METHOD=POST> In this case, the ACTION attribute of the FORM tag tells the server to use the "NetForms.acgi" application (located in the root directory) to process the data using the FDML document named "MyFDML.fdml" (also located in the root directory). Here, NetForms.acgi is specified with a relative path because it is located on the same server as the form being accessed. In this case, either a relative or an absolute path may be used. If the entry form is on a different Web server, however, then an absolute URL must be used. In either case the path to the FDML file is always relative to the location of the NetForms root folder. The following example uses the same syntax as above but with an absolute path, which would be used if the form were located on another Web server: <FORM ACTION="http://www.myserver.com/NetForms.acgi$/MyFDML.fdml" METHOD=POST> If you are using a web server which supports the concept of server-based "actions" and "suffix mappings", you can simplify the ACTION attribute of your FORM tags. Web server "actions" and "suffix mappings" let the server determine automatically which CGI should process form data based on the "suffix" of the file specified in a URL. For example, you could set up the web server so that all files that end with the suffix ".fdml" are to be processed by the NetForms CGI. WebSTAR was the first Macintosh web server to support this feature. Using the "Auto-Map" menu in NetForms (see the section "Configuring Your Server"), you can have NetForms set up WebSTAR this way automatically. Once you have set up an "action" and a "suffix mapping" in your web server, the ACTION attribute of the FORM tag can become simply the URL of the FDML file to be processed. For example, the form command above would become: <FORM ACTION="/MyFDML.fdml" METHOD=POST> You can also set
up WebSTAR yourself to have NetForms process any file you
want, automatically. See "Suffix Mappings" in the WebSTAR
User's Guide for details. The METHOD Attribute There are two methods of sending form data from a Web browser to a server: GET and POST. NetForms supports either method. The GET method encodes the form data and appends it to the URL specified in the ACTION attribute as "search arguments". Search arguments follow a question mark (?) character in the URL received by the server. Because URLs are limited to a length of 1024 characters, including the protocol, server name, file path, and search arguments, this limits the length of data that can be sent using the GET method. Ordinarily, HTML forms use the POST method. Using the POST method, the encoded form data is sent in the content of the message sent from the browser to the server. All this means is that there is no limit to the length of data you can send using the POST method. However, NetForms has a limit of 32Kb (32,768 characters) of data that can be received using the POST method. In either case, you must specify the method you want to use in the METHOD attribute of the FORM tag, as in these examples: <FORM ACTION="/MyFDML.fdml" METHOD=GET> <FORM ACTION="/MyFDML.fdml" METHOD=POST> Protecting the Form Finally, if you
would like only certain users to have the capability to
enter articles, you can protect an entry form in several
ways. Using Maxum Development's NetCloak, you can hide a
link to an entry form, effectively barring the user from
submitting data to NetForms. You can also use Maxum's
WebLock to password-protect an HTML entry form page. For
more information on NetCloak or WebLock, visit
"http://:www.maxum.com/." Finally, you can use your Web
server's built-in security realm feature to password-protect
an entry form. Check your Web server's documentation for
details on security realms and password
protection. To allow users to enter data into your form, you will also need some entry fields. There are various types of entry fields, most of which correspond to user-interface elements you are already familiar with from the dialog boxes on your computer. Every form field tag must include a name attribute. Later, when creating FDML documents, fields must be referred to by name. Other attributes are particular to each field type, such as type, value or size. For most field types the type attribute is required, but others may be optional. Text Box
Password Box
Text Area
Checkbox
Radio Buttons <INPUT TYPE="radio" NAME="myButtons" CHECKED VALUE="button1"> <INPUT TYPE="radio" NAME="myButtons" VALUE="button2">
Pop-up Menu <SELECT NAME="myPopup"> <OPTION VALUE="1" SELECTED>first <OPTION VALUE="2">second <OPTION VALUE="3">third </SELECT>
Scrolling List <SELECT MULTIPLE SIZE=3 NAME="myList"> <OPTION VALUE="1" SELECTED>first <OPTION VALUE="2">second <OPTION VALUE="3">third <OPTION VALUE="4">fourth </SELECT>
Hidden Field <INPUT TYPE="hidden" NAME="myInvisible" VALUE="you can't see this!">
Submit Button <INPUT TYPE="submit" NAME="Submit Form">
|
|
|
Home | Information | Our Services | Web Hosting | Technical Support Education | Web Site Design | Search the Web | Useful Sites |