<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
  <title>Insert into how-to Database</title>
  <LINK REL="stylesheet" HREF="/PHP/style.css">
  <META NAME="author"      CONTENT="Denice Deatrich">
  <META NAME="description" CONTENT="PHP web-based MySQL DB Management">
  <META NAME="keywords"    CONTENT="PHP web MySQL database">
</head>

<body>
  <h1>Insert into how-to Database</h1>
<?php
  
require( "db_connect.php" );
  
checkDBStatus( );
  if( (
$link=mysql_pconnect($DB_HOST, $DB_USER, $DB_PW)) ) {
    
$topic = trim( $topic );
    
$ver = trim( $ver );
    
$keywords = trim( $keywords );
    if(
strlen($ver) <= 0 ) {
      
$ver = "*";
    }
    if(
strlen($topic) <= 0 ) {
      
printFields( "TOPIC is a required field",
       
$topic, $os, $ver, $arch, $keywords, $notes );
    }
    else if(
strlen($keywords) <= 0 ) {
      
printFields( "KEYWORDS is a required field",
      
$topic, $os, $ver, $arch, $keywords, $notes );
    }
    else if(
$res=mysql_db_query($DB_NAME,
      
"insert into how_to (topic, os, ver, arch, keywords, notes) values (\"$topic\", \"$os\", \"$ver\", \"$arch\", \"$keywords\", \"$notes\")", $link) ) {
      echo
"Insert successful.";
    }
    else {
      
printError( "INSERT", $link );
    }
  }
/*
  else {
    printError( "CONNECT", $topic, $os, $ver, $arch, $keywords, $notes );
  }
*/
?>
  <hr>
  <div class="footer">
  <address>
    <a href="mailto&#058;Denice&#046;Deatrich&#064;epfl.ch">Denice Deatrich</a>
  </address>
<!-- Created: Sun Jan 16 17:22:34 MET 2000 -->
<!-- hhmts start -->
Last modified: Sat Jun  3 11:06:42 MEST 2000
<!-- hhmts end -->
  </div>
</body>
</html>