include('global.php'); include('navigation.php'); if ($_POST[catName]) { $catBelow = ($_POST[catBelow]) ? $_POST[catBelow] : "NULL"; $sql = "INSERT INTO categories ( catName, catOrder, catBelow) VALUES ( '" . text_in($_POST[catName]) . "', '" . text_in($_POST[catOrder]) . "', $catBelow)"; mysql_query($sql, $conn) or die(mysql_error()); header("location: subcategories.php?catId=$catBelow"); } echo page_headers(html, "PP3", 'global, navigation, form'); ?>