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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
<?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"); $conid = $_POST["conid"]; $conpagemodule = htmlspecialchars($_POST["conpagemodule"],ENT_QUOTES); $contitleen = htmlspecialchars($_POST["contitleen"],ENT_QUOTES); $contitlesc = htmlspecialchars($_POST["contitlesc"],ENT_QUOTES); $condescen = preg_replace("/'/","\'",$_POST["condescen"]); $condescsc = preg_replace("/'/","\'",$_POST["condescsc"]); $conbannerlinken = htmlspecialchars($_POST["conbannerlinken"],ENT_QUOTES); $conbannerlinksc = htmlspecialchars($_POST["conbannerlinksc"],ENT_QUOTES); $metatitleen = htmlspecialchars($_POST["metatitleen"],ENT_QUOTES); $metakeyworden = htmlspecialchars($_POST["metakeyworden"],ENT_QUOTES); $metadescen = htmlspecialchars($_POST["metadescen"],ENT_QUOTES); $metatitlesc = htmlspecialchars($_POST["metatitlesc"],ENT_QUOTES); $metakeywordsc = htmlspecialchars($_POST["metakeywordsc"],ENT_QUOTES); $metadescsc = htmlspecialchars($_POST["metadescsc"],ENT_QUOTES); $nowdate = date("Y-m-d H:i:s"); //print_r($_POST);
if ($_FILES['conbanneren']['name'] <> '') { if (($_FILES["conbanneren"]["type"] == "image/bmp") || ($_FILES["conbanneren"]["type"] == "image/BMP") || ($_FILES["conbanneren"]["type"] == "image/gif") || ($_FILES["conbanneren"]["type"] == "image/GIF") || ($_FILES["conbanneren"]["type"] == "image/jpg") || ($_FILES["conbanneren"]["type"] == "image/JPG") || ($_FILES["conbanneren"]["type"] == "image/jpeg") || ($_FILES["conbanneren"]["type"] == "image/JPEG") || ($_FILES["conbanneren"]["type"] == "image/pjpeg") || ($_FILES["conbanneren"]["type"] == "image/PJEG") || ($_FILES["conbanneren"]["type"] == "image/png") || ($_FILES["conbanneren"]["type"] == "image/x-png") || ($_FILES["conbanneren"]["type"] == "image/PNG") || ($_FILES["conbanneren"]["type"] == "image/X-PNG")) { $filename=$_FILES['conbanneren']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['conbanneren']['tmp_name'], "../pagebanner/conid_".$conid."_en.".$file_ext[1]) or die ("Could not copy the file: 联系我们 Banner(EN)"); $conbanneren = "conid_".$conid."_en.".$file_ext[1]; $conbanneren = htmlspecialchars($conbanneren,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $conbanneren = ""; }
if ($_FILES['conbannersc']['name'] <> '') { if (($_FILES["conbannersc"]["type"] == "image/bmp") || ($_FILES["conbannersc"]["type"] == "image/BMP") || ($_FILES["conbannersc"]["type"] == "image/gif") || ($_FILES["conbannersc"]["type"] == "image/GIF") || ($_FILES["conbannersc"]["type"] == "image/jpg") || ($_FILES["conbannersc"]["type"] == "image/JPG") || ($_FILES["conbannersc"]["type"] == "image/jpeg") || ($_FILES["conbannersc"]["type"] == "image/JPEG") || ($_FILES["conbannersc"]["type"] == "image/pjpeg") || ($_FILES["conbannersc"]["type"] == "image/PJEG") || ($_FILES["conbannersc"]["type"] == "image/png") || ($_FILES["conbannersc"]["type"] == "image/x-png") || ($_FILES["conbannersc"]["type"] == "image/PNG") || ($_FILES["conbannersc"]["type"] == "image/X-PNG")) { $filename=$_FILES['conbannersc']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['conbannersc']['tmp_name'], "../pagebanner/conid_".$conid."_sc.".$file_ext[1]) or die ("Could not copy the file: 联系我们 Banner(EN)"); $conbannersc = "conid_".$conid."_sc.".$file_ext[1]; $conbannersc = htmlspecialchars($conbannersc,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $conbannersc = ""; }
// Modify $sql = "update contactus set conpagemodule='$conpagemodule', contitleen='$contitleen', contitlesc='$contitlesc', condescen='$condescen', condescsc='$condescsc', conbannerlinken='$conbannerlinken', conbannerlinksc='$conbannerlinksc', metatitleen='$metatitleen', metakeyworden='$metakeyworden', metadescen='$metadescen', metatitlesc='$metatitlesc', metakeywordsc='$metakeywordsc', metadescsc='$metadescsc', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' "; if (($conbanneren <> '')) { $sql .= ", conbanneren='$conbanneren' "; } else if ($_POST['delconbanneren'] <> '') { $sql .= ", conbanneren='' "; } if (($conbannersc <> '')) { $sql .= ", conbannersc='$conbannersc' "; } else if ($_POST['delconbannersc'] <> '') { $sql .= ", conbannersc='' "; } $sql .= " where conid=". $conid ." "; mysql_query($sql);
if( mysql_errno() > 0 ){ echo 'Modify 联系我们 Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; }
mysql_close($dbh);
header("Location: contact_index.php?msg=修改成功"); ?>
|