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"); $hbrandid = $_POST["hbrandid"]; $hbrandlinken = htmlspecialchars($_POST["hbrandlinken"],ENT_QUOTES); $hbrandlinksc = htmlspecialchars($_POST["hbrandlinksc"],ENT_QUOTES); $nowdate = date("Y-m-d H:i:s"); //print_r($_POST);
if ($_FILES['hbrandimgen']['name'] <> '') { if (($_FILES["hbrandimgen"]["type"] == "image/bmp") || ($_FILES["hbrandimgen"]["type"] == "image/BMP") || ($_FILES["hbrandimgen"]["type"] == "image/gif") || ($_FILES["hbrandimgen"]["type"] == "image/GIF") || ($_FILES["hbrandimgen"]["type"] == "image/jpg") || ($_FILES["hbrandimgen"]["type"] == "image/JPG") || ($_FILES["hbrandimgen"]["type"] == "image/jpeg") || ($_FILES["hbrandimgen"]["type"] == "image/JPEG") || ($_FILES["hbrandimgen"]["type"] == "image/pjpeg") || ($_FILES["hbrandimgen"]["type"] == "image/PJEG") || ($_FILES["hbrandimgen"]["type"] == "image/png") || ($_FILES["hbrandimgen"]["type"] == "image/x-png") || ($_FILES["hbrandimgen"]["type"] == "image/PNG") || ($_FILES["hbrandimgen"]["type"] == "image/X-PNG")) { $filename=$_FILES['hbrandimgen']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); move_uploaded_file ($_FILES['hbrandimgen']['tmp_name'], "../brand/id_".$hbrandid."_en.".$file_ext[1]) or die ("Could not copy the file: 主页 商标(EN)"); $hbrandimgen = "id_".$hbrandid."_en.".$file_ext[1]; $hbrandimgen = htmlspecialchars($hbrandimgen,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $hbrandimgen = ""; }
if ($_FILES['hbrandimgsc']['name'] <> '') { if (($_FILES["hbrandimgsc"]["type"] == "image/bmp") || ($_FILES["hbrandimgsc"]["type"] == "image/BMP") || ($_FILES["hbrandimgsc"]["type"] == "image/gif") || ($_FILES["hbrandimgsc"]["type"] == "image/GIF") || ($_FILES["hbrandimgsc"]["type"] == "image/jpg") || ($_FILES["hbrandimgsc"]["type"] == "image/JPG") || ($_FILES["hbrandimgsc"]["type"] == "image/jpeg") || ($_FILES["hbrandimgsc"]["type"] == "image/JPEG") || ($_FILES["hbrandimgsc"]["type"] == "image/pjpeg") || ($_FILES["hbrandimgsc"]["type"] == "image/PJEG") || ($_FILES["hbrandimgsc"]["type"] == "image/png") || ($_FILES["hbrandimgsc"]["type"] == "image/x-png") || ($_FILES["hbrandimgsc"]["type"] == "image/PNG") || ($_FILES["hbrandimgsc"]["type"] == "image/X-PNG")) { $filename=$_FILES['hbrandimgsc']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); move_uploaded_file ($_FILES['hbrandimgsc']['tmp_name'], "../brand/id_".$hbrandid."_sc.".$file_ext[1]) or die ("Could not copy the file: 主页 商标(EN)"); $hbrandimgsc = "id_".$hbrandid."_sc.".$file_ext[1]; $hbrandimgsc = htmlspecialchars($hbrandimgsc,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $hbrandimgsc = ""; }
// Modify $sql = "update h_brand set hbrandlinken='$hbrandlinken', hbrandlinksc='$hbrandlinksc', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' "; if ($hbrandimgen <> '') $sql .= ", hbrandimgen='$hbrandimgen' "; if ($hbrandimgsc <> '') $sql .= ", hbrandimgsc='$hbrandimgsc' "; $sql .= " where hbrandid=". $hbrandid ." "; mysql_query($sql);
if( mysql_errno() > 0 ){ echo 'Modify 主页 商标 Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; }
mysql_close($dbh);
header("Location: h_brand_index.php?msg=修改成功"); ?>
|