function addCategorie() { if (isset($_POST['cat'])) { if (checkCat($_POST['cat']) == 0) { saveCat($_POST['cat']); echo '<script type="text/javascript">', 'document.location.replace("../View/Categories.php");', '</script>'; } else { } } }
} elseif (strpos($uri, 'trang/')) { $mod = "page"; } elseif (strpos($uri, 'tin-tuc')) { $mod = "news"; } elseif (strpos($uri, 'chi-tiet-tin')) { $mod = "news-detail"; } else { $mod = "home"; } } //if(strpos(, needle)) //var_dump($mod); return array("mod" => $mod); } $uri = $_SERVER['REQUEST_URI']; $arrRS = checkCat($uri); $mod = $arrRS['mod']; $uri = str_replace(".html", "", $uri); $tmp_uri = explode("/", $uri); if ($mod == '') { if (isset($_GET["payment"]) && $_GET['payment'] == "success") { unset($_SESSION["cart"]); } } switch ($mod) { case "news": /*$tieude_id = $tmp_uri[1]; $arr = explode("-", $tieude_id); $page = (int) end($arr); $page = ($page==0) ? 1 : $page; */