/var/www/(Del)explorer-island.com/old/webadmin/coursecatmodify.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
<?php require("configure.php"); ?>
<?
$hotcourse    
$_POST["hotcourse"];
$ccatid        $_POST["ccatid"];
$ccatnameen    htmlspecialchars($_POST["ccatnameen"],ENT_QUOTES);
$ccatdescen    preg_replace("/'/","\'",$_POST["ccatdescen"]);
$ccatnametc    htmlspecialchars($_POST["ccatnametc"],ENT_QUOTES);
$ccatdesctc    preg_replace("/'/","\'",$_POST["ccatdesctc"]);
$cstyleid    $_POST["cstyleid"];
$cpref         $_POST["orderno"];

if (
$_FILES['hotcourseimg']['name'] <> '')
{
    
copy ($_FILES['hotcourseimg']['tmp_name'], "hotcourseimg/".$ccatid.$_FILES['hotcourseimg']['name']) 
        or die (
"Could not copy");
    
    
$hotcourseimg $ccatid.$_FILES['hotcourseimg']['name'];
}
else
{
    
$hotcourseimg "";
}

$sql "update coursecat set ccatid='$ccatid', ccatnameen='$ccatnameen', ccatdescen='$ccatdescen', ccatnametc='$ccatnametc', ccatdesctc='$ccatdesctc', cstyleid='$cstyleid', hotcourse='$hotcourse', pref=$cpref ";
if (
$hotcourseimg <> '')
    
$sql .= ", hotcourseimg='$hotcourseimg' ";
$sql .= "where ccatid="$ccatid ." ";
//echo $sql;
mysql_query($sql);
mysql_close($dbh);

header("Location: coursecatindex.php?msg=Update Successful");
?>