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


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

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

    
$discatsort htmlspecialchars($_POST["discatsort"], ENT_QUOTES);
    
$discatname htmlspecialchars($_POST["discatname"], ENT_QUOTES);

    
$sql "select max(discatid) as maxid ";
    
$sql .= "from districtcat";
    
$result   mysql_query($sql);
    
$row      mysql_fetch_array($resultMYSQL_ASSOC);
    
$discatid $row{maxid} + 1;

    
$sql "insert into districtcat (discatid, discatname, discatsort) values ('$discatid', '$discatname', '$discatsort')";
//echo $sql;
    
mysql_query($sql);
    
mysql_close($dbh);

    
header("Location: districtcatindex.php?msg=Add Successful");
?>