/var/www/(Del)asld.org.hk/webadmin/advimagemodify.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
36
37
38
39
40
41
42
<?php
require 'check_login.php';
if (
$logged_in <> 1) {
    
header('Location: login.php');
    return;
}
else
{
?>
<?php 
require("configure.php"); ?>
<?
$advid            
$_POST["advid"];
$advlink        $_POST["advlink"];
$advsort        $_POST["advsort"];
$advstatus        $_POST["advstatus"];


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



$sql "update adv set advid='$advid', advlink='$advlink', advsort='$advsort' ";
if (
$advimage <> '')
    
$sql .= ", advimage='$advimage' ";
$sql .= "where advid="$advid ." ";
//echo $sql;
mysql_query($sql);
mysql_close($dbh);

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