All pastes #940268 Raw Edit

ShowTape.php

public text v1 · immutable
·published 2008-03-12 21:18 UTC
rendered paste body
<?php
/*  Program name: displayAddress
 *  Description:  Script displays a form with address
 *                information obtained from the database.
 */
  echo "<html>
        <head><title>ShowTapes</title></head>
        <body>";
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");
  $result = @mysql_query("SELECT * FROM Tapes WHERE tapeType='$_POST[tapetype]'")  or die ("Couldn't execute query");
/*
  $query = "SELECT * FROM Tapes WHERE tapeType='$tapeType'";
  $result = mysql_query($query) or die ("Couldn't execute query.");
*/

  echo "<br><p align='center'> <h1 align='center'>Information for tape type $_POST[tapetype]</h1>\n";
  echo "<br><p align='center'> <font size='+1'>
        <b>Please check the information below and change any information that is incorrect.</b></font><hr>";


  echo "<FORM ACTION='UpdateTapeInfo.php' Method='POST'>
        <table width='95%' border='1' cellspacing='0' cellpadding='2'>\n";

//  <TH>Key</TH>
echo "<TR>
  <TH>Tape Label</TH>
  <TH>Last Used</TH>
  <TH>Current Location</TH>
  <TH>Last Location</TH>
  <TH>Changed</TH>
  <TH>Last Changed</TH>
</TR>";
/*
  print "\$_POST[tapetype] = {$_POST[tapetype]}\n<br>";
*/

// Display the Tape Label of each tape in a paragraph
//       <tr>$row[key]</TD>
while ($row = mysql_fetch_array($result)) {

   echo "<tr><td valign='top' width='15%'>\n";
   echo "<input type='radio' name='TapeLabel' value='$row[TapeLabel]'<font size='+1'><b>$row[TapeLabel]</b></font></TD>
         <td>$row[LastUsed]</TD>
         <td>$row[CurrentLocation]</TD>
         <td>$row[LastLocation]</TD>
         <td>$row[Changed]</TD>
         <td>$row[LastChanged]</TD>
         </TR>";
  }
  echo "</table>
        <div align='center'><p>
        <a href='http://mfnlamp1/TapeTracker/TapeCatalog.php' target='_self' >Main Menu</a>
        <input type='submit' value='Update Selected Record'>
        </p></div>
        </form>";
/*
echo "<FORM ACTION='processform.php' Method='get'>
 echo "First Name       <input type='text' value='' name='txtFName' size='24'><br>
Last Name       <input type='text' value='' name='txtLName' size='24'><br>
Date of Birth   <input type='text' value='' name='txtFName' size='24'<<br>
Gender  Male <input type='radio' value='male' checked name='mf'>
Female <input type='radio' value='female' name='mf'><br>
Email   <input type='text' value='' name='txtFName' size='24'><br>
Address         <textarea rows='4' name='S2' cols='20'></textarea><br>
<INPUT TYPE='submit' value='Submit Information'>
<INPUT TYPE='reset' value='Clear All'>
</FORM>";


/*
  $query = "UPDATE MFNFABTapeLog
                SET tapeType='$row[2]',
  print "\$query = $query\n<br>";
  $result = mysql_query($query) or die ("Couldn't execute query.");
*/

?>
</body></html>