/var/www/(Del)asld.org.hk/webadmin/categoriesadd.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
    
require("configure.php");

    if (!isset(
$_SESSION["cmslogin"])) {
        
header("Location: login.php");
        exit;
    }

    
$pid          $_POST["pid"];
    
$catname      htmlspecialchars($_POST["catname"], ENT_QUOTES);
    
$sortby       $_POST["sortby"];
    
$templateid   $_POST["templateid"];
    
$cathyperlink htmlspecialchars($_POST["cathyperlink"], ENT_QUOTES);
    
$cattitle     htmlspecialchars($_POST["cattitle"], ENT_QUOTES);

    
mysql_query("insert into categories (parentid, catname, sortby, templateid, cattitle, cathyperlink) values ('$pid', '$catname', $sortby, '$templateid', '$cattitle', '$cathyperlink')");
    
mysql_close($dbh);

    
header("Location: categoriesindex.php?pid=$pid&msg=Add Successful");
?>