/var/www/(Del)asld.org.hk/webadmin/pubeduadd.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
25
26
<?php
    
require("configure.php");

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

    
$publink  htmlspecialchars($_POST["publink"], ENT_QUOTES);
    
$pubtitle htmlspecialchars($_POST["pubtitle"], ENT_QUOTES);
    
$pubdate  htmlspecialchars($_POST["pubdate"], ENT_QUOTES);


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

    
$sql "insert into pub (pubid, publink, pubtitle, pubdate) values ('$pubid', '$publink', '$pubtitle', '$pubdate')";
//echo $sql;
    
mysql_query($sql);
    
mysql_close($dbh);

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