A Complete Guide to Web Design

(やまだぃちぅ) #1
250 Chapter 12 – Forms

Demystifying CGI


Web Design in a Nutshell, eMatter Edition

last;
}
}
}
else {
$check_referer = 1;
}
# If the HTTP_REFERER was invalid, send back an error.
#
if ($check_referer != 1) { &error('bad_referer') }
}
[remaining script omitted]


  1. Add mandatory controls to the form. The FormMail script relies on the
    following hidden input control, which must be included in the form. It tells
    the script who to mail the form results to.

  2. Add optional controls to the form. The FormMail documentation also provides
    a listing of other form controls you might include in your form and the exact
    HTML for creating them. The following is an example taken from the docu-
    mentation that describes how to specify the “subject” field of an email
    message generated by the script:
    Field:
    subject
    Description:
    The subject field allows you to specify the subject you wish to appear in
    the e-mail sent to you after this form has been filled out. If you do not
    have this option turned on, the script will default to a message subject:
    WWW Form Submission
    Syntax:
    If you wish to choose what the subject is:
    To allow the user to choose a subject:


  3. Upload the script, following the instructions of your server administrator. Be
    sure that you have included the proper pathname to the script with the action
    attribute in the
    tag.

Free download pdf