Harvard Extension School, Fall 2018
CSCI E-12 Fundamentals of Web Site Development

## form

Attributes

- method ("get" or "post")
- action (URL of CGI program)
- enctype

Each element within a form has a name associated with it. When the information is sent back to the server, the CGI program will access the information by name. Thus, the front-end form and the back-end program must use the same names.

While exploring forms, it is useful to use a simple "echo" CGI program, which will simply echo back the name/value information your form submitted (https://cscie12.dce.harvard.edu/echo).

Example 3.1 - Simple form - Example 3.1 | <form method="post" action="https://cscie12.dce.harvard.edu/echo" enctype="application/x-www-form-urlencoded"> Email Address:<input type="text" name="email"/><br/><input type="submit"/></form>

- Markup
- Display

    <form method="post" action="https://cscie12.dce.harvard.edu/echo">
    Email Address:
    <input type="text" name="email"/><br/>
    <input type="submit"/>
    </form>

Email Address:

Copyright © David Heitmeyer