/var/www/(Del)therainbows.org.hk/webadmin/ttmadd.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"); ?>
<?
$ttmtitleen    
htmlspecialchars($_POST["ttmtitleen"],ENT_QUOTES);
$ttmtitletc    htmlspecialchars($_POST["ttmtitletc"],ENT_QUOTES);
$ttmtitlesc    htmlspecialchars($_POST["ttmtitlesc"],ENT_QUOTES);

$ttmdescen     preg_replace("/'/","\'",$_POST["ttmdescen"]);
$ttmdesctc     preg_replace("/'/","\'",$_POST["ttmdesctc"]);
$ttmdescsc     preg_replace("/'/","\'",$_POST["ttmdescsc"]);


$sql "select max(ttmid) as maxid ";
$sql .= "from ttm";
$result=mysql_query($sql);
$row mysql_fetch_array($result,MYSQL_ASSOC);
$ttmid $row{maxid}+1;

$sql "insert into ttm (ttmid, ttmtitleen, ttmdescen, ttmtitletc, ttmdesctc, ttmtitlesc, ttmdescsc) values ('$ttmid', '$ttmtitleen', '$ttmdescen', '$ttmtitletc', '$ttmdesctc', '$ttmtitlesc', '$ttmdescsc')";
//echo $sql;
mysql_query($sql);
mysql_close($dbh);

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