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"); $solid = $_POST["solid"]; $solpagemodule = htmlspecialchars($_POST["solpagemodule"],ENT_QUOTES); $soltitleen = htmlspecialchars($_POST["soltitleen"],ENT_QUOTES); $soltitlesc = htmlspecialchars($_POST["soltitlesc"],ENT_QUOTES); $soldescen = preg_replace("/'/","\'",$_POST["soldescen"]); $soldescsc = preg_replace("/'/","\'",$_POST["soldescsc"]); $solbannerlinken = htmlspecialchars($_POST["solbannerlinken"],ENT_QUOTES); $solbannerlinksc = htmlspecialchars($_POST["solbannerlinksc"],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['solbanneren']['name'] <> '') { if (($_FILES["solbanneren"]["type"] == "image/bmp") || ($_FILES["solbanneren"]["type"] == "image/BMP") || ($_FILES["solbanneren"]["type"] == "image/gif") || ($_FILES["solbanneren"]["type"] == "image/GIF") || ($_FILES["solbanneren"]["type"] == "image/jpg") || ($_FILES["solbanneren"]["type"] == "image/JPG") || ($_FILES["solbanneren"]["type"] == "image/jpeg") || ($_FILES["solbanneren"]["type"] == "image/JPEG") || ($_FILES["solbanneren"]["type"] == "image/pjpeg") || ($_FILES["solbanneren"]["type"] == "image/PJEG") || ($_FILES["solbanneren"]["type"] == "image/png") || ($_FILES["solbanneren"]["type"] == "image/x-png") || ($_FILES["solbanneren"]["type"] == "image/PNG") || ($_FILES["solbanneren"]["type"] == "image/X-PNG")) { $filename=$_FILES['solbanneren']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['solbanneren']['tmp_name'], "../pagebanner/solid_".$solid."_en.".$file_ext[1]) or die ("Could not copy the file: Solution Banner(EN)"); $solbanneren = "solid_".$solid."_en.".$file_ext[1]; $solbanneren = htmlspecialchars($solbanneren,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $solbanneren = ""; }
if ($_FILES['solbannersc']['name'] <> '') { if (($_FILES["solbannersc"]["type"] == "image/bmp") || ($_FILES["solbannersc"]["type"] == "image/BMP") || ($_FILES["solbannersc"]["type"] == "image/gif") || ($_FILES["solbannersc"]["type"] == "image/GIF") || ($_FILES["solbannersc"]["type"] == "image/jpg") || ($_FILES["solbannersc"]["type"] == "image/JPG") || ($_FILES["solbannersc"]["type"] == "image/jpeg") || ($_FILES["solbannersc"]["type"] == "image/JPEG") || ($_FILES["solbannersc"]["type"] == "image/pjpeg") || ($_FILES["solbannersc"]["type"] == "image/PJEG") || ($_FILES["solbannersc"]["type"] == "image/png") || ($_FILES["solbannersc"]["type"] == "image/x-png") || ($_FILES["solbannersc"]["type"] == "image/PNG") || ($_FILES["solbannersc"]["type"] == "image/X-PNG")) { $filename=$_FILES['solbannersc']['name']; preg_match("/\.([^\.]+)$/", $filename, $file_ext); copy ($_FILES['solbannersc']['tmp_name'], "../pagebanner/solid_".$solid."_sc.".$file_ext[1]) or die ("Could not copy the file: Solution Banner(EN)"); $solbannersc = "solid_".$solid."_sc.".$file_ext[1]; $solbannersc = htmlspecialchars($solbannersc,ENT_QUOTES); } else { // upload error ?> <script language="javascript"> alert("Files must be BMP, JPEG, GIF, or PNG"); history.back(); </script> <?php exit; }
} else { $solbannersc = ""; }
// Modify $sql = "update solution set solpagemodule='$solpagemodule', soltitleen='$soltitleen', soltitlesc='$soltitlesc', soldescen='$soldescen', soldescsc='$soldescsc', solbannerlinken='$solbannerlinken', solbannerlinksc='$solbannerlinksc', metatitleen='$metatitleen', metakeyworden='$metakeyworden', metadescen='$metadescen', metatitlesc='$metatitlesc', metakeywordsc='$metakeywordsc', metadescsc='$metadescsc', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' "; if (($solbanneren <> '')) { $sql .= ", solbanneren='$solbanneren' "; } else if ($_POST['delsolbanneren'] <> '') { $sql .= ", solbanneren='' "; } if (($solbannersc <> '')) { $sql .= ", solbannersc='$solbannersc' "; } else if ($_POST['delsolbannersc'] <> '') { $sql .= ", solbannersc='' "; } $sql .= " where solid=". $solid ." "; mysql_query($sql);
if( mysql_errno() > 0 ){ echo 'Modify Solution Error:<br />'. mysql_error() .'<br />SQL: '. $sql; exit; }
mysql_close($dbh);
header("Location: solution_index.php?msg=修改成功"); ?>
|