include ("config.php"); include ("include.php"); include ("lang.php"); include ("include_banned.php"); if ($c == 0){ header("Location: {$dir}index.php"); exit(); }; $sql = mysql_query("SELECT name, title, description, pages, ref FROM {$prefix}categories WHERE id = $c"); $current_category = mysql_fetch_array($sql, MYSQL_ASSOC); if (($c > 1) & !$current_category["name"]){ header("Location: {$dir}index.php"); }; if (!$current_category["name"]) { $current_category["name"] = "Directory Search"; }; if (!$current_category["title"]) { $current_category["title"] = $current_category["name"]; }; if (!$current_category["description"]) { $current_category["description"] = $current_category["name"]." ".$current_category["title"]; }; if (getenv("REQUEST_METHOD") == "POST"){ include ("include_protection.php"); $url = convert_url($url); $keywords = convert_keywords($keywords); $url = parse_input($url); $title = parse_input($title); $description = parse_input($description); $keywords = parse_input($keywords); $sql = mysql_query("SELECT * FROM {$prefix}pages WHERE url = '$url'"); if (mysql_num_rows($sql) > 0){ $error_duplication = true; }else{ if (strlen($title) < 5 || strlen($title) > 100) { $error_variables = true; $errors["title"] = true; }; if (strlen($description) < 50 || strlen($description) > 200) { $error_variables = true; $errors["description"] = true; }; if (strlen($keywords) < 20 || strlen($keywords) > 200) { $error_variables = true; $errors["keywords"] = true; }; if (strlen($url) < 10) { $error_variables = true; $errors["url"] = true; }; if (!$error_variables){ mysql_query("INSERT INTO {$prefix}pages (url,title,description,keywords,accepted,ip,category) VALUES ('$url','$title','$description','$keywords','n','".getenv("REMOTE_ADDR")."',$c)"); }; }; }; $last_category = false; $ref = $c; while(!$last_category){ $n_parent_categories += 1; $sql = mysql_query("SELECT id, name, ref FROM {$prefix}categories WHERE id = $ref"); $parent_categories[$n_parent_categories-1] = mysql_fetch_array($sql, MYSQL_ASSOC); if ($parent_categories[$n_parent_categories-1]["ref"] == 0){ $last_category = true; }else{ $ref = $parent_categories[$n_parent_categories-1]["ref"]; }; }; ?>