At
NetRunner, we allow all of our users to create mail forms
and Imagemaps. This is not hard. For some reason though
it's given nothing but headaches to a few of our users,
these are passed on to everyone's favorite Webmaster
(me). With nearly over 3000 users I cannot hold each
individuals hand and guide them through this personally. The Three Steps Create The Form The Form: The source (my instruction appears in the "commented areas" which is rendered bright yellow in Netscape 2.0x and greater and Internet Explorer) <form
METHOD="POST" <!--This Tag begins the form and calls the cgi program 'cgiemail'. You must replace ~beta with your user directory and test.txt with the name of the text file which you will create in step two. If the text file is not in the root of your public_html, you must put the full path to the subdirectory it is in-> From: <input name="required-from"><p> <!--This is our first field. It is special in that it demonstrates one of the features of cgiemail. The "name" has a required element. This makes the completion of this field mandatory before the form can be submitted. The syntax must exactly match the above, only the 'from' part may be replaced i.e. "required-agreement", "required-blood_type","required-phone" etc.-> I have done
the following today: <!--This next group represents a checkbox type of response. The user may select as many options as they want (this is important to remember when you make your text file). Note: each value is more than one word but appears as only one word to the parser because they are separated by an underscore. This is a good practice as it make life easier for both the server and for you if you decide to import this information into a database. -> I
think:<br> <!--Like checkbox fields radio buttons each have the same name. The difference is, only one may be selected. To have a choice "preselected" use the word 'checked' in the tag. -> <B>My
main goal in life is:</B><br> <!--A drop down list box. Remember that each choice will have a different size when formatting the text file.-> Other
comments:<p> <!--Text areas can be any size you desire. It's wisest to place these near or at the bottom of the form. -> <input type="submit" value="Send email"> <!--This is the button that sends the e-mail. Anything placed in the value will appear as text in the button. You may also put in a reset button by making another tag similar to submit but with the type of "reset" -> <input type="hidden" name="addendum" value="Thank you for your input. Your message is hurdling through Cyberspace even as you read this. Press the Back Button to return to the forms page. From there you can enjoy the rest of our site."> <!--Hidden tags are form elements which are not seen in the rendered form but contain information passed on to the cgi program. In our case there "addendum" passes along information pertaining to the "Afterbirth" document. That b eing the case, we will review the available options in Part 3- "Creating the Afterbirth Document". -> </form> <!--Don't forget to close the Form! -> The Text File Theory: The text
file tells the cgi program where to send this and the
format of the body. It consists of two parts:
Let's take each
one individually: The body is pretty much up to you. How you format it depends on what you are going to do with it. Just remember: each field name must match exactly in case and spelling with the field name in the form. Here is an example of a layout which is good if you s imply desire to read the results. I have
[donewhat] If you intend to import this information into a database or spreadsheet, you can format it like this: [donewhat],[thoughts],[goal], [comments] As far as
formatting the body is concerned, you are limited only by
your imagination.
Once you've completed the text file name it the same as the name of the form and give it an extension of text. IT MUST BE PLACED IN THE SAME SUBDIRECTORY AS THE FORM!!!!!!!!!!!!!!!!! Be sure to upload it as ASCII. If you up it as a BINARY, it will gain control^M chara^Mcters which may well ruin the formatting. The AfterBirth Document After the form is submitted the user is presented with a page which shows what they have submitted in the formatting you have specified in your text file. This is rather boring and very impersonal. You can change this in two ways. Remember the "hidden field" in the form? <input type="hidden" name="addendum" value="Thank you for your input. Your message is hurdling through Cyberspace even as you read this. Press the Back Button to return to the forms page. From there you can enjoy the rest of our site."> This places what is entered as a value under the information submitted. If that isn't enough for you, you can list a URL for the returned page: <input type="hidden" name="success" value="http://www.netrunner.net/response.html"> This displays the page "response.html" after the form is successfully sent. Of course the page can contain graphics or any other element you desire. Webmasters Note:
It doesn't work!!!!!!!!!! If your form doesn't work, here are a few places to look for the reason: |
Copyright 1997-2023 NetRunner Inc. All Rights Reserved. |