CS501

MP13 - The Visitors Book (Phase II)


The Task

In this MP you are going to modify the form you created in MP12 to allow users to view the information you have saved in your visitors book.

The Steps

  1. Modify the web page containing your visitors book entry code to include a button that will invoke a Perl script that displays the contents of your visitors book file. An example with two buttons is shown below.
  2. Create a Perl script that will display your visitors book contents.


What You Will Turn In

A sheet containing your name, assignment number, course name, link to cgi/bin script (like http://mathcssun1.emporia.edu/~ppalmsha/mp13.cgi) and a listing the script.


Using Another Script

The example below shows an html file which includes two buttons, each which invokes a different Perl script. See bolded portion.

<html>

<head>
<title>A simple form example</title>
</head>

<body>

<h1>This is a simple form using cgi-lib.pl</h1>

<p>This is a sample form which demonstrates the use of the <b><a HREF="cgi-lib.pl">cgi-lib.pl</a></b>
library of routines for managing form input. </p>

<hr>

<form method="post" action="simple-form.cgi">
  <h2>Pop Quiz: </h2>
  <p>What is thy name: <input name="name"></p>
  <p>What is thy quest: <input name="quest"></p>
  <p>What is thy favorite color: <select name="color" size="1">
    <option selected>chartreuse </option>
    <option>azure </option>
    <option>puce </option>
    <option>cornflower </option>
    <option>olive draub </option>
    <option>gunmetal </option>
    <option>indigo2 </option>
    <option>blanched almond </option>
    <option>flesh </option>
    <option>ochre </option>
    <option>opal </option>
    <option>amber </option>
    <option>mustard </option>
  </select> </p>
  <p>What is the weight of a swallow: <input type="radio" name="swallow" value="african"
  checked> African Swallow or <input type="radio" name="swallow" value="continental">
  Continental Swallow </p>
  <p>What do you have to say for yourself <textarea name="text" rows="5" cols="60"></textarea>
  </p>
  <p>Press <input type="submit" value="here"> to submit your query. </p>
</form>
<form method="post" action="stuff.cgi">
<p>Press <input type="submit" value="here"> to see your IP number. </p>
</form>
<hr>

<address>
  Steven E. Brenner / cgi-lib@pobox.com
</address>

<p>$Date: 1996/07/31 16:35:21 $ </p>
</body>
</html>