function Do_Cat_Add() { global $INSTALLER09, $mc1; $htmlout = ''; if (empty($_POST['name']) || strlen($_POST['name']) > 100) { stderr("Error", "Field is blank or length too long!"); } if (empty($_POST['shortcut']) || strlen($_POST['shortcut']) > 100) { stderr("Error", "Field is blank or length too long!"); } $cat_name = sqlesc(strip_tags($_POST['name'])); $cat_scut = sqlesc(strip_tags($_POST['shortcut'])); $min_view = sqlesc(strip_tags($_POST['min_view'])); $sql = "INSERT INTO rules_cat (name, shortcut, min_view) VALUES ({$cat_name}, {$cat_scut}, {$min_view})"; sql_query($sql) or sqlerr(__FILE__, __LINE__); if (mysqli_affected_rows($GLOBALS["___mysqli_ston"]) == -1) { stderr("Warning", "Couldn't forefill that request"); } $mc1->delete_value('rules__'); $htmlout .= New_Cat_Form(1); echo stdhead("Add New Title") . $htmlout . stdfoot(); exit; }
function Do_Cat_Add() { if (empty($_POST['rcat_name']) || strlen($_POST['rcat_name']) > 100) { Do_Error("Error", "Field is blank or length too long!"); } $cat_name = sqlesc(strip_tags($_POST['rcat_name'])); $sql = "INSERT INTO rules_categories (rcat_name) VALUES ({$cat_name})"; @mysql_query($sql); if (mysql_affected_rows() == -1) { stderr("Warning", "Couldn't forefill that request"); } stdhead("Add New heading"); New_Cat_Form(1); stdfoot(); exit; }