<?php
$DB_HOST
= "putYourSQL_HostNameHere";
$DB_USER = "putYourDB_OwnerHere";
$DB_NAME = "putYourDB_NameHere";
$DB_PW = "putYourDB_OwnerPasswordHere";
$STATUS_FILE = "/tmp/status.sql";

function
printError( $str, $link ) {
  
printf( "<font color=\"red\">Err: %s -- %s: %s</font><BR>\n",
   
$str,mysql_errno($link), mysql_error($link) );
}

function
checkDBStatus( ) {
  global
$STATUS_FILE;
  
clearstatcache();
  if(
file_exists($STATUS_FILE) ) {
    
printf( "<FONT COLOR=\"red\">
     <I>Sorry, the database is not available.</I></FONT><BR>\n"
);
    
printf( "Please try again in a few moments.<BR>\n" );
    exit;
  }
}

function
printFields( $str, $topic, $os, $ver, $arch, $keywords, $notes )
{
  
printf("<font color=\"red\">Error in submitted data:</font><BR>\n" );
  
printf("TOPIC:    %s<BR>\n", $topic );
  
printf("OS:       %s<BR>\n", $os );
  
printf("VER:      %s<BR>\n", $ver );
  
printf("ARCH:     %s<BR>\n", $arch );
  
printf("KEYWORDS: %s<BR>\n", $keywords );
  
printf("NOTES:    %s ...<BR>\n", substr($notes, 0, 10) );
  
printf("<BR><font color=\"red\">%s</font><BR>\n", $str );
}

?>