Location: PHPKode > projects > Radtracker > radtracker/addtopic.php
<?php
//This page allows support staff to add topics.
session_register("lname");
session_register("pass");
include("pagefunctions.php");
include("checkuser.php");
$userstatus = checkuser($lname, $pass);
if ($userstatus == "isvalid") {
  gentop("Add a Topic");
if ($topic) {
  $sql_command = "INSERT INTO category (Category) VALUES ('$topic')";
  $sql_result = mysql_query($sql_command,$connection) or die (mysql_error());
  $extra = "Category \"$topic\" has been added<br><br>";
}
  echo "<table align='center' border=1 cellspacing=2 cellpadding=2>\n
        <tr>\n
        <td colspan=2 align='center'><h1>Add a Topic</h1>$extra</td>
        </tr>
        <tr>
        <td><font size='2'>New Category: </font></td><td><form method=\"post\" action=\"addtopic.php\"><input type=\"text\" name='topic'></td>
        </tr>
        <tr><td colspan='2' align='center'><input type='submit'></td></tr>
        </table>
        ";
  genbottom();
}

else {
    global $serverhome;
  header("Location: " . $serverhome . "/radtracker/login.php?from=$PHP_SELF");
}

?>
Return current item: Radtracker