/var/www/hkosl.com/kelvin/webadmin/gallery_modify.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
27
28
29
30
31
32
33
34
35
<?php
include 'config.php';

// Check if the user is logged in

if ((!isSet($_SESSION['loginname'])) || ($loggin <> '1'))
{
header("Location: login.php");
exit;
}
require(
"configure.php");
    
$galleryid check_input($_POST["galleryid"]);
    
$gallerytitleen     check_input($_POST["gallerytitleen"]);
    
$gallerytitletc     check_input($_POST["gallerytitletc"]);
    
$belongpage    check_input($_POST["menuid"]);
    
$belongcatid    check_input($_POST["belongcatid"]);
    
$menuid check_input($_REQUEST["menuid"]);
    
$nowdate             date("Y-m-d H:i:s");
//print_r($_POST);


// Modify 
$sql "update gallery set belongpage='$belongpage',belongcatid='$belongcatid',gallerytitleen='$gallerytitleen', gallerytitletc='$gallerytitletc',lastupdate='$nowdate', lastupby='".$_SESSION['cmsloginid']."' ";
$sql .= " where galleryid='$galleryid'";
mysql_query($sql);

if( 
mysql_errno() > ){
    echo 
'Modify Gallery Error:<br />'mysql_error() .'<br />SQL: '$sql;
    exit;
}

mysql_close($dbh);

header("Location: gallery_index.php?menuid=$menuid&msg=Modify Successful");
?>