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
|
<?php require("configure.php"); ?> <? $catid = $_POST["catid"]; $parentid = $_POST["parentid"]; //$catname = $_POST["catname"]; $catname = htmlspecialchars($_POST["catname"],ENT_QUOTES); $sortby = $_POST["sortby"]; $gallery = $_POST["gallery"]; //$pagecontent = $_POST["pagecontent"]; $pagecontent = preg_replace("/'/","\'",$_POST["pagecontent"]);
if ($pagecontent <> '') { $template = "page.php?parentid=".$parentid."&pagecontentid=".$pagecontent; } elseif ($gallery <> '') { $template = "gallery.php?parentid=".$parentid."&galleryid=".$gallery; }
$sql = "update categories set catid='$catid', catname='$catname', sortby='$sortby', pagecontent='$pagecontent', gallery='$gallery', template='$template' "; $sql .= " where catid=". $catid ." "; //echo $sql; mysql_query($sql); mysql_close($dbh);
header("Location: categoriesindex.php?pid=$catid&msg=Update Successful"); ?>
|