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); $pubtopic = htmlspecialchars($_POST["pubtopic"], ENT_QUOTES); $pubdate = htmlspecialchars($_POST["pubdate"], ENT_QUOTES);
$sql = "select max(pubid) as maxid "; $sql .= "from pubhistory"; $result = mysql_query($sql); $row = mysql_fetch_array($result, MYSQL_ASSOC); $pubid = $row{maxid} + 1;
$sql = "insert into pubhistory (pubid, publink, pubtopic, pubdate) values ('$pubid', '$publink', '$pubtopic', '$pubdate')"; //echo $sql; mysql_query($sql); mysql_close($dbh);
header("Location: pubhistoryindex.php?msg=Add Successful"); ?>
|