All pastes #940257 Raw Edit

Tape Catalog

public text v1 · immutable
·published 2008-03-12 21:09 UTC
rendered paste body
<?php
/* Program: TapeCatalog.php
* Desc: Displays a list of tape categories from the
* TapeType table. Includes descriptions.
* User checks radio button.
*/
?>
<html>
<head><title>Tape Catalog</title></head>
<body>
<?php
include('misc.inc');
$connection = mysql_connect($host,$user,$password) or die ('couldn’t connect to server');
$db = mysql_select_db($database,$connection) or die ('Couldn’t select database');
/* Select all categories from TapeType table */
$query = 'SELECT * FROM TapeType ORDER BY tapeType';
$result = mysql_query($query)  or die ('Couldn’t execute query.');
/* Display text before form */
echo "<html> <div style=’margin-left: .1in’>
<h1 align=’center’>Tape Catalog</h1>
<h2 align=’center’>The following Tapes are available.</h2> </b>";
/* Create form containing selection list */

  /* create form containing radio buttons */
  echo "<form action='ShowTapes.php' method='POST'>\n";

  while ($row = mysql_fetch_array($result))
  {
     extract($row);
     echo "<input type='radio' name='tapetype' value='$tapeType'><font size=’+1’><b>$tapeType</b></font> $typeDescription\n";
     echo "<br>\n";
  }
echo "<p><input type='submit' value='Display Tapes for selected type'>
        </form>\n";
?>
</div>
</body></html>
mfnlamp1 TapeTracker $