/var/www/(Del)tsolpv.com/2013/webadmin/h_slideshow_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?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");
 
$hsid             $_POST["hsid"];
$hslinken        htmlspecialchars($_POST["hslinken"],ENT_QUOTES);
$hslinksc        htmlspecialchars($_POST["hslinksc"],ENT_QUOTES);
$nowdate             date("Y-m-d H:i:s");
//print_r($_POST);

if ($_FILES['hsimgen']['name'] <> '')
{
    if ((
$_FILES["hsimgen"]["type"] == "image/bmp") || ($_FILES["hsimgen"]["type"] == "image/BMP") || ($_FILES["hsimgen"]["type"] == "image/gif") || ($_FILES["hsimgen"]["type"] == "image/GIF") || ($_FILES["hsimgen"]["type"] == "image/jpg") || ($_FILES["hsimgen"]["type"] == "image/JPG") || ($_FILES["hsimgen"]["type"] == "image/jpeg") || ($_FILES["hsimgen"]["type"] == "image/JPEG") || ($_FILES["hsimgen"]["type"] == "image/pjpeg") || ($_FILES["hsimgen"]["type"] == "image/PJEG") || ($_FILES["hsimgen"]["type"] == "image/png") || ($_FILES["hsimgen"]["type"] == "image/x-png") || ($_FILES["hsimgen"]["type"] == "image/PNG") || ($_FILES["hsimgen"]["type"] == "image/X-PNG"))
    {
        
$filename=$_FILES['hsimgen']['name'];
        
preg_match("/\.([^\.]+)$/"$filename$file_ext);
        
        
move_uploaded_file ($_FILES['hsimgen']['tmp_name'], "../slideshow/id_".$hsid."_en.".$file_ext[1]) 
                or die (
"Could not copy the file: 主页 幻燈片(EN)"); 
        
        
$hsimgen     "id_".$hsid."_en.".$file_ext[1];
        
$hsimgen    htmlspecialchars($hsimgen,ENT_QUOTES);
      }
    else
      {
      
// upload error
      
?>
        <script language="javascript">
        alert("Files must be BMP, JPEG, GIF, or PNG");
        history.back();
        </script>
     <?php
     
exit;
     }

}
else
{
    
$hsimgen "";
}

if (
$_FILES['hsimgsc']['name'] <> '')
{
    if ((
$_FILES["hsimgsc"]["type"] == "image/bmp") || ($_FILES["hsimgsc"]["type"] == "image/BMP") || ($_FILES["hsimgsc"]["type"] == "image/gif") || ($_FILES["hsimgsc"]["type"] == "image/GIF") || ($_FILES["hsimgsc"]["type"] == "image/jpg") || ($_FILES["hsimgsc"]["type"] == "image/JPG") || ($_FILES["hsimgsc"]["type"] == "image/jpeg") || ($_FILES["hsimgsc"]["type"] == "image/JPEG") || ($_FILES["hsimgsc"]["type"] == "image/pjpeg") || ($_FILES["hsimgsc"]["type"] == "image/PJEG") || ($_FILES["hsimgsc"]["type"] == "image/png") || ($_FILES["hsimgsc"]["type"] == "image/x-png") || ($_FILES["hsimgsc"]["type"] == "image/PNG") || ($_FILES["hsimgsc"]["type"] == "image/X-PNG"))
    {
        
$filename=$_FILES['hsimgsc']['name'];
        
preg_match("/\.([^\.]+)$/"$filename$file_ext);
        
        
move_uploaded_file ($_FILES['hsimgsc']['tmp_name'], "../slideshow/id_".$hsid."_sc.".$file_ext[1]) 
                or die (
"Could not copy the file: 主页 幻燈片(EN)"); 
        
        
$hsimgsc     "id_".$hsid."_sc.".$file_ext[1];
        
$hsimgsc    htmlspecialchars($hsimgsc,ENT_QUOTES);
      }
    else
      {
      
// upload error
      
?>
        <script language="javascript">
        alert("Files must be BMP, JPEG, GIF, or PNG");
        history.back();
        </script>
     <?php
     
exit;
     }

}
else
{
    
$hsimgsc "";
}

// Modify 
$sql "update h_slideshow set hslinken='$hslinken', hslinksc='$hslinksc', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' ";
if (
$hsimgen <> '')
    
$sql .= ", hsimgen='$hsimgen' ";
if (
$hsimgsc <> '')
    
$sql .= ", hsimgsc='$hsimgsc' ";
$sql .= " where hsid="$hsid ." ";
mysql_query($sql);

if( 
mysql_errno() > ){
    echo 
'Modify 主页 幻燈片 Error:<br />'mysql_error() .'<br />SQL: '$sql;
    exit;
}

mysql_close($dbh);

header("Location: h_slideshow_index.php?msg=修改成功");
?>