Example #1
0
    $newcats = explode(";", $_POST["addcategory"]);
    $i = 0;
    while ($newcats[$i]) {
        $newcats[$i] = trim($newcats[$i]);
        if (strlen($newcats[$i]) > 0) {
            $db->query("insert into `categories` set `name` = '" . mysql_escape_string($newcats[$i]) . "', `sub_cat_id` = '" . $_GET["CatID"] . "'");
        }
        $i++;
    }
    header("Location: ViewCat.php?" . CCGetQueryString("QueryString", array()));
}
$itemcatcounts = get_catcounts($_GET["CatID"]);
if (!CCGetUserID() && $_GET["CatID"]) {
    $db = new CLSDBNetConnect();
    $query = "select * from categories where cat_id=" . $_GET["CatID"];
    $db->query($query);
    if ($db->next_record()) {
        if ($db->f("member") == 1) {
            CCSecurityRedirect("1;2", "login.php", "ViewCat.php", CCGetQueryString("QueryString", ""));
        }
    }
}
//End Include Common Files
$page = "Viewing Listings";
global $REMOTE_ADDR;
global $now;
$ip = $REMOTE_ADDR;
$timeout = $now["timeout"];
$db1 = new clsDBNetConnect();
$db2 = new clsDBNetConnect();
$db3 = new clsDBNetConnect();