How do I setup a web order form?

Overview: The Netmar Mail Script, along with the standard SSL secure web server and/or Netmar SecureCard, allow you to receive just about any information from the visitors of your website, while providing, where necessary, a completely encrypted channel of communication. An HTML form is the simplest way to get information from your visitors.

These instructions will lead you through creating an HTML form. For details on all of the features available, see the Mail Script Manual Page.

Any of the steps that begins with OPTIONALLY, may be skipped.

Before Beginning
Determine where you want the results of the form sent and whether or not the information is sensitive and needs to be encrypted.
Follow these steps
  1. Login via telnet (see Question 1.9) and type:

    edit www/order.htmland press ENTER. You can replace order.html with the name you want to give your order page, or a new name you want to use.

    OR
  2. Startup your favorite HTML editor on your own computer. If you edit the file on your own computer, you will need to upload it later.
  3. Enter the FORM tag. If you're using SSL or regular unencrypted service, type:

    <FORM ACTION="/cgi-bin/mail" METHOD="POST">

    If you're using Netmar SecureCard, type:

    <FORM ACTION="/cgi-bin/decode" METHOD="POST">

  4. Enter a line which assigns a value to the special CGI variable, "to":

    <input type="hidden" name="to" value="user@netmar.com">

    Replace user@netmar.comwith the email address to which you want the results of the form sent.

  5. Optionally, if you want to send copies of the resulting email to others, enter a line which assigns a value to the special CGI variable, "cc":

    <input type="hidden" name="cc" value="user@netmar.com">

    Replace user@netmar.comwith the email address(es) to which you want the results of the form sent. More than one address should be separate by commas.

  6. Optionally, if you want the user's name to appear on the return address of the email message created by the form, enter a line which assigns a value to the special CGI variable, "name " to allow the user of the form to supply their name:

    <input type="text" name="name">

    This will create a textbox for the user to enter their name.

  7. Optionally, if you want the resulting email message to have the user's email address as the return address, enter a line which assigns a value to the special CGI variable, "email" to allow the user of the form to supply their email address:

    <input type="text" name="email">

    This will create a text box for the user to enter their email address.

  8. Optionally, if you want to specify or allow the user of the form to specify what will go on the subject line of the resulting email message, enter a line which assigns a value to the special CGI variable, "subject" to allow the user of the form to supply a subject for the message, or to assign a subject yourself. This would allow you to enter a subject:

    <input type="hidden" name="subject" value="Some Subject">

    by replacing the words Some Subject with whatever you want to appear on the subject line of the resulting email message.

  9. Enter a line which assigns a value to the special CGI variable, "next" to designate the web page that the user will see after submitting the form:

    <input type="hidden" name="next" value="somefile.phtml">

    OR

    <input type="hidden" name="next" value="http://somewhere.com/somefile.html">

    Replace somefile.phtmlor http://somewhere.com/somefile.htmlwith the webpage filename or URL address that you want the user to see AFTER submitting the form. If you use just a filename, you can use a parseable template as discussed in Step 19 to include data that the user entered in the screen the user sees.

  10. Optionally, if you want to create a formatted email message instead of just a list of variables and values, enter a line which assigns a value to the special CGI variable, "emailtemplate" to designate a file to be used as a template for generating the resulting email message from this form. Creating this file is discussed in Step 20.

    <input type="hidden" name="emailtemplate" value="somefile.etemp">

    Replace somefile.etemp with the name of the file you would like to use as a template.

  11. Optionally, if you want to send an email message BACK to the person filling out the form, enter a line which assigns a value to the special CGI variable, "confirm" to designate both a file to be used as a template for generating an email message to be sent BACK TO THE USER as well as the email address from which that message should appear to come. Creating this file is discussed in Step #.

    <input type="hidden" name="confirm" value="sales@netmar.com; confirm.etemp">

    Replace sales@netmar.com with the address from which you'd like the confirmation email message to appear to originate. Replace confirm.etemp with the name of the file you would like to use as a template for this confirmation email message.

  12. Optionally, if you want to encrypt the resulting email message before it is sent, enter a line which assigns a value to the special CGI variable, "pgp" to designate the Netmar username whose public keyring should be used (typically, your own Netmar username), as well as the PGP Key ID (PGP Username) of the key on that keyring that should be used to encrypt the email message.

    <input type="hidden" name="pgp" value="johndoe; John Doe">

    See Question 3.9 for information on setting up PGP in your Netmar account.

  13. Optionally, if you want to require the user of the form to enter data for certain fields, enter a line which assigns a value to the special CGI variable, "require" to designate the CGI variables which must contain data, as well as a file to be displayed if no data is included in some of those fields.

    <input type="hidden" name="require" value="var1 var2 var3; somefile.phtml">

    Replace "var1 var2 var3" with a list of CGI variables that you want to restrict, and replace somefile.phtml with the file you would like displayed if one or more of those fields is left blank.

  14. Optionally, if you want to require the user of the form to enter a valid credit card number in one or more fields, enter a line which assigns a value to the special CGI variable, "is_ccard" to designate the CGI variables which must contain valid credit card numbers, as well as a file to be displayed if displayed if one of the fields contains invalid data.

    <input type="hidden" name="is_ccard" value="var1 var2 var3; somefile.phtml">

    Replace "var1 var2 var3" with a list of CGI variables that you want to restrict, and replace somefile.phtml with the file you would like displayed if one or more of those fields contains invalid data.

    Note: Thie function DOES NOT connect to any banking computer to verify the card number. Rather, it simply performs the mathematical checksum calculations on the digits of the number to determine if it COULD BE USED as a credit card number.

  15. Optionally, if you want to require the user of the form to enter a valid email address in one or more fields, enter a line which assigns a value to the special CGI variable, "is_email" to designate the CGI variables which must contain valid email addresses, as well as a file to be displayed if displayed if one of the fields contains invalid data.

    <input type="hidden" name="is_email" value="var1 var2 var3; somefile.phtml">

    Replace "var1 var2 var3" with a list of CGI variables that you want to restrict, and replace somefile.phtml with the file you would like displayed if one or more of those fields contains invalid data.

  16. Optionally, if you want to require the user of the form to enter a valid web address in one or more fields, enter a line which assigns a value to the special CGI variable, "is_web" to designate the CGI variables which must contain valid email addresses, as well as a file to be displayed if displayed if one of the fields contains invalid data.

    <input type="hidden" name="is_web" value="var1 var2 var3; somefile.phtml">

    Replace "var1 var2 var3" with a list of CGI variables that you want to restrict, and replace somefile.phtml with the file you would like displayed if one or more of those fields contains invalid data.

  17. Include a line for a SUBMIT button and end the form:

    <input type="submit"></FORM>

  18. Save the form by typing CONTROL-X (hold down the CONTROL key and press the letter X key), followed by Y and ENTER
    OR
    Save the form in your HTML editor and upload it via FTP (see Question 1.1).
  19. If you specified a file in Step 9, at the netmar> prompt, type:

    edit www/somefile.phtmland press ENTER. Replace somefile.phtml with the filename you used in Step 9.

    Enter the HTML for the webpage you want displayed after the user presses the SUBMIT button. In this file, you can include data from the form by using subcodes-- codes matching CGI variable names-- surrounded by ${}. For instance, if you wanted to include the user's name, you would include the text:

    ${name}

    For a more detailed explanation of the features available to you in creating this template, see the Mail Script Manual Page

  20. If you specified a file in Step 10, at the netmar> prompt, type:

    edit www/somefile.etempand press ENTER. Replace somefile.etemp with the filename you used in Step 10.

    Enter the email message format you want created when the email message is generated by the form. In this file, you can include data entered by the user by using subcodes-- codes matching CGI variable names-- surrounded by ${}. For instance, if you wanted to include the user's name, you would include the text:

    ${name}

    For a more detailed explanation of the features available to you in creating this template, see the Mail Script Manual Page. The first line of this file should be the Subject line:

    Subject: ${subject}

    followed by a blank line.

  21. If you included a confirm line in Step 11, repeat step 10 to create another template for the email to be sent back to the user of the form.
  22. If you included anything for Steps 13-16, repeat Step 19 to create HTML pages to be displayed for each of those rules.
  23. Your form is now completed and ready for use.
with whatever you want to appear on the subject line of the resulting email message.