<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>
    Three WWW Form Examples for Dal CS 4173: Web-centric Computing
  </title>
  <link rev="Made"    href="mailto:jamie@cs.dal.ca" />
  <link rel="stylesheet" type="text/css" 
        href="/~jamie/course/CS/4173/CS4173.css" />
  <style type="text/css">
    div.form { border:medium #060 outset }
    div.col  { float:left; width:44%; margin:1% }
    hr.shh   { display:none }
  </style>
  <link rel="SHORTCUT ICON"
        href="favicon.ico" />
 </head>
 <body>
 <p class="topaut">
  <a title="professor's homepage"
     href="/~jamie/"
     ><abbr>J.</abbr>&#160;Blustein</a>
 </p>
 <h1><a href="/~jamie/course/CS/4173/"
        title="course homepage"
        accesskey="1"
        >Web-centric Computing</a></h1>

  <p class="mini-menu">
   [<a href="/~jamie/course/CS/4173/Course/" accesskey="C"
       title="administrative files for the course"
       ><abbr title="course">Crs</abbr></a>&#160;| 
    <a href="/~jamie/course/CS/4173/Announcements/" accesskey="A"
       title="announcements section of the course website"
       ><abbr title="announcements">Ann</abbr></a>&#160;|
    <a href="/~jamie/course/CS/4173/Materials/" accesskey="M"
       title="course materials (supplied by professor)"
       ><em><abbr title="materials">Mats</abbr></em></a>&#160;|
    <a href="/~jamie/course/CS/4173/Resources/" accesskey="R"
       title="resources section of the website"
       ><abbr title="resources">Res</abbr></a>]
  </p>

  <h2><a href="/~jamie/course/CS/4173/examples/list.html"
         >Example Code</a></h2>

  <h3><a href="/~jamie/course/CS/4173/examples/list.html#forms"
         ><acronym title="common gateway interface">CGI</acronym>
         Forms</a>: How Forms Are Processed</h3>

  <h4>Three <code>form</code>s</h4>

  <div class="centre">
    <div class="col form">
     <h3>
      <code>"post"</code> Form
     </h3>
  
     <form action="/~jamie/cgi-bin/3171/form-processing.cgi" method="post">
      <p>
       Name:&nbsp;<input name="name" /><br />
       CS student:&nbsp;Yes<input
          type="radio" name="CS" value="t" /> or No<input
          type="radio" name="CS" value="f" />
       <input type="hidden" name="hidden" value="secret data" />
       <br />
       <!--input type="reset"  value="Clear" /-->
       <input type="submit" value="POST"  />
      </p>
     </form>
    </div> 
   
    <hr class="shh" />
   
    <div class="col form"> 
     <h3>
      <code>"get"</code> Form
     </h3>
   
     <form action="/~jamie/cgi-bin/3171/form-processing.cgi" method="get">
      <p>
       Name:&nbsp;<input name="name" /><br />
       CS student:&nbsp;Yes<input
          type="radio" name="CS" value="t" /> or No<input
          type="radio" name="CS" value="f" />
       <input type="hidden" name="hidden" value="secret data" />
       <br />
       <!--input type="reset"  value="Clear" /-->
       <input type="submit" value="GET"   />
      </p>
     </form>
    </div> 
  </div>
 
  <hr style="clear:both;display:hidden" />

  <!-- <p><br style="clear:both" /></p> -->

  <div class="form centre" style="width:65%" >
     <h3>
      <code>"post"</code> File Upload Form
     </h3>
    <form method="post"  
      enctype="multipart/form-data"
      accept="text/plain"
      action="http://users.cs.dal.ca/~jamie/cgi-bin/3171/form-processing.cgi">
     <p>
       <input type="file"   name="upload" size="20" />
      <br />
       <input type="hidden" name="hidden" value="secret data" />
       <input type="submit" name="submit" value="POST file" />
      </p>
    </form>
  </div>

  <hr title="end of document proper" style="clear:both" />

  <h6 title="document identification information"
     ><kbd>
      http://www.cs.dal.ca/~jamie/course/CS/4173/Materials/examples/CGI/form/three-penny-form.html
      </kbd>
  </h6>
    <dl style="display:compact; float:left">
      <dt>Version:</dt> <dd>30 May 2003</dd>
   
      <dt><a href="/~jamie/course/CS/4173/"
             title="course homepage"
             ><acronym title="computer science"
            >CS</acronym> 4173</a> <abbr
          title="professor">Prof.</abbr>:</dt>
      <dd><a title="professor's homepage"
             href="/%7ejamie/"
             accesskey="J"
             ><abbr>J.</abbr>&#160;Blustein</a>
          <kbd>&lt;jamie@cs.dal.ca&gt;</kbd></dd>
    </dl>

    <p style="float:right">
     <a href="http://validator.w3.org/check/referer"
        class="offsite"
        accesskey="V"
        title="link requests HTML validator at W3C to check this file for adherence to standard"
        ><img
           src="/~jamie/image/vxhtml10.gif"
           alt="This webpage uses valid XHTML 1.0"
           style="height:31px; width:88px" /></a>
    </p>
 </body>
</html>
