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
116
|
<?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"); $aboid = $_POST["aboid"]; $abopagemodule = htmlspecialchars($_POST["abopagemodule"],ENT_QUOTES); $abotitleen = htmlspecialchars($_POST["abotitleen"],ENT_QUOTES); $abotitlesc = htmlspecialchars($_POST["abotitlesc"],ENT_QUOTES); $abodescen = preg_replace("/'/","\'",$_POST["abodescen"]); $abodescsc = preg_replace("/'/","\'",$_POST["abodescsc"]); $abobannerlinken = htmlspecialchars($_POST["abobannerlinken"],ENT_QUOTES); $abobannerlinksc = htmlspecialchars($_POST["abobannerlinksc"],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['abobanneren']['name'] <> '') { if (($_FILES["abobanneren"]["type"] == "image/bmp") || ($_FILES["abobanneren"]["type"] == "image/BMP") || ($_FILES["abobanneren"]["type"] == "image/gif") || ($_FILES["abobanneren"]["type"] == "image/GIF") || ($_FILES["abobanneren"]["type"] == "image/jpg") || ($_FILES["abobanneren"]["type"] == "image/JPG") || ($_FILES["abobanneren"]["type"] == "image/jpeg") || ($_FILES["abobanneren"]["type"] == "image/JPEG") || ($_FILES["abobanneren"]["type"] == "image/pjpeg") || ($_FILES["abobanneren"]["type"] == "image/PJEG") || ($_FILES["abobanneren"]["type"] == "image/png") || ($_FILES["abobanneren"]["type"] == "image/x-png") || ($_FILES["abobanneren"]["type"] == "image/PNG") || ($_FILES["abobanneren"]["type"] == "image/X-PNG")) { $filename=$_FILES['abobanneren']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['abobanneren']['tmp_name'], "../pagebanner/aboid_".$aboid."_en.".$file_ext[1]) or die ("Could not copy the file: 关于我们 Banner(EN)"); $abobanneren = "aboid_".$aboid."_en.".$file_ext[1]; $abobanneren = htmlspecialchars($abobanneren,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $abobanneren = ""; }
if ($_FILES['abobannersc']['name'] <> '') { if (($_FILES["abobannersc"]["type"] == "image/bmp") || ($_FILES["abobannersc"]["type"] == "image/BMP") || ($_FILES["abobannersc"]["type"] == "image/gif") || ($_FILES["abobannersc"]["type"] == "image/GIF") || ($_FILES["abobannersc"]["type"] == "image/jpg") || ($_FILES["abobannersc"]["type"] == "image/JPG") || ($_FILES["abobannersc"]["type"] == "image/jpeg") || ($_FILES["abobannersc"]["type"] == "image/JPEG") || ($_FILES["abobannersc"]["type"] == "image/pjpeg") || ($_FILES["abobannersc"]["type"] == "image/PJEG") || ($_FILES["abobannersc"]["type"] == "image/png") || ($_FILES["abobannersc"]["type"] == "image/x-png") || ($_FILES["abobannersc"]["type"] == "image/PNG") || ($_FILES["abobannersc"]["type"] == "image/X-PNG")) { $filename=$_FILES['abobannersc']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['abobannersc']['tmp_name'], "../pagebanner/aboid_".$aboid."_sc.".$file_ext[1]) or die ("Could not copy the file: 关于我们 Banner(EN)"); $abobannersc = "aboid_".$aboid."_sc.".$file_ext[1]; $abobannersc = htmlspecialchars($abobannersc,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $abobannersc = ""; }
// Modify $sql = "update aboutus set abopagemodule='$abopagemodule', abotitleen='$abotitleen', abotitlesc='$abotitlesc', abodescen='$abodescen', abodescsc='$abodescsc', abobannerlinken='$abobannerlinken', abobannerlinksc='$abobannerlinksc', metatitleen='$metatitleen', metakeyworden='$metakeyworden', metadescen='$metadescen', metatitlesc='$metatitlesc', metakeywordsc='$metakeywordsc', metadescsc='$metadescsc', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' "; if (($abobanneren <> '')) { $sql .= ", abobanneren='$abobanneren' "; } else if ($_POST['delabobanneren'] <> '') { $sql .= ", abobanneren='' "; } if (($abobannersc <> '')) { $sql .= ", abobannersc='$abobannersc' "; } else if ($_POST['delabobannersc'] <> '') { $sql .= ", abobannersc='' "; }
$sql .= " where aboid=". $aboid ." "; mysql_query($sql);
if( mysql_errno() > 0 ){ echo 'Modify 关于我们 Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; }
mysql_close($dbh);
header("Location: aboutus_index.php?msg=修改成功"); ?>
|