Location: PHPKode > projects > The Referral Database > referralsdb/edit_category.php
<?php

// include function files for this application
require_once("referrals_fns.php"); 
session_start();

do_html_header("Updating category");
if (check_admin_user())
{ 
   if (empty($_POST["catname"])) {
      echo "No category name specified, please try again.";

   } elseif (filled_out($_POST)) {
      if ($_POST["catname"] == $_POST["oldcatname"]) {
         echo "Please enter a <i>new</i> category name.";
      } else {
         // from admin_fns.php
         $errlevel = update_category($_POST["catid"], $_POST["catname"]);
         if ("1" == $errlevel) {
            echo "Category was updated.<br>";

         } elseif ("2" == $errlevel)  {
            echo "Category already exists.<br>";
         } elseif ("0" == $errlevel)  {
            echo_db_error();
         }
      }
   }

} else {
     echo "You are not authorized to view this page."; 
}

do_html_footer();

?>
Return current item: The Referral Database