1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php require("configure.php"); ?> <? $newsdate = $_POST["newsdate"]; $newstitleen = htmlspecialchars($_POST["newstitleen"],ENT_QUOTES); $newsdescen = preg_replace("/'/","\'",$_POST["newsdescen"]); $newstitletc = htmlspecialchars($_POST["newstitletc"],ENT_QUOTES); $newsdesctc = preg_replace("/'/","\'",$_POST["newsdesctc"]);
print_r($_POST);
$sql = "select max(newsid) as maxid "; $sql .= "from news "; $result=mysql_query($sql); $row = mysql_fetch_array($result,MYSQL_ASSOC); $newsid = $row{maxid}+1;
mysql_query("insert into news (newsid, newsdate, newstitleen, newsdescen, newstitletc, newsdesctc, lastupdate) values ('$newsid', '$newsdate', '$newstitleen', '$newsdescen', '$newstitletc', '$newsdesctc', '1')"); mysql_close($dbh);
header("Location: newsindex.php?msg=Update Successful"); ?>
|