Creating a simple form using Netcloak commands:

Here is an example of a form to send a message from your website, it will be delivered to your email. We use Netcloak to process the file, it only works if the action file is named .FDML (.FDML files cannot be displayed in a web browser so the email address of the form recipient is hidden from spammers).

 

There are four files that need to be created:

1. The HTML form

2. A file named something.FDML which contains the instructions on what to do with the form.

3. An error.html file which will show if the user does not enter his/her email address.

4. A RESPONSE file like thanks.html which will show after the form is submitted. This file can include form parameters so you could say "Thanks John, john@mac.com for completing the form".

The form action statement for the form should be like:

<FORM ACTION="some_file_name.FDML" METHOD=POST enctype="x-www-form-encoded">

Here is the form code in its entirety (colors, fonts except removed for clarity).

<TABLE WIDTH=500 BORDER=0></p>
<TR align="center"><TD COLSPAN=2>To contact MacTalent please complete the form below.</TD></TR>
<TR><TD Your Name:</TD>
<TD><INPUT TYPE=text NAME=name VALUE="" SIZE=30></TD></TR>
<TR><TD>Your Email Address:</TD>
<TD><INPUT TYPE=text NAME=email VALUE="" SIZE=30></TD></TR>
<TR><TD>Message Subject:</TD>
<TD><INPUT TYPE=text NAME="message_subject" VALUE="" SIZE=40></TD></TR>
<TR><TD>Message:</TD>
<TD><TEXTAREA NAME=message ROWS=7 COLS=40 WRAP=virtual></TEXTAREA></TD></TR>
<TR align="center"><TD colspan="2"><INPUT TYPE=submit NAME=Submit VALUE="Submit"></td> </TR>
</TABLE>

The FDML file should reside in the same folder as the form. It should be a text file, create it with BBedit, TextEdit, Notepad, not in Dreamweaver.

Here is the FDML file code:

<RESPONSE>"thanks.html"</RESPONSE>


<VERIFY email>"error.html"</VERIFY>


<SENDMAIL "your_mail_server.com" "your_email@your_domain.com" "<REPLACE email>"> "some_cc_address@something.com"[Web Contact] from <REPLACE Name></SENDMAIL>


<REPLACE name> [<replace email>] said: <replace message>

Note the SENDMAIL can have the following parameters: MAIL-SERVER, TO, FROM, CC

(CC email address is optional)

The is used to replace the contents of the form field so you need a replace statement for each form field on your form.

The RESPONSE page is an HTML page. If you want the response page to include any of the form fields then put on the HTML page, like <replace some_field_name_value>.

The "error.html" statement allows you to check that the email address was entered, as the form will not send without a sender email. (You could use your email as both TO and FROM if you wanted to have a form that did not require an email to be entered.

Here is an example error page

<HTML>
You did not fill out the form completely.
Please enter your E-mail address.

<a href="javascript:history.go(-1)">
Please go back</a> and try again
</BODY>
</HTML>

There are many more complex things that can be done with forms. For example multiple forms can be chained together so that the first form goes to you, the second form goes to the sender (perhaps with some info redacted). In addition the values from the forms could be stored in a tab-delimited text file. For more help see the Netcloak docs at http://www.mactalent.com/help/