| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/c-c.com.hk/webadmin/ |
Upload File : |
<?php require_once("configure.php");
$aboutid = $_POST["aboutid"];
$abouttitleen = htmlspecialchars($_POST["abouttitleen"],ENT_QUOTES);
$aboutdescen = preg_replace("/'/","\'",$_POST["aboutdescen"]);
$nowdate = date("Y-m-d H:i:s");
//print_r($_POST);
if ($_FILES['aboutimage']['name'] <> '')
{
if (($_FILES["aboutimage"]["type"] == "image/bmp") || ($_FILES["aboutimage"]["type"] == "image/BMP") || ($_FILES["aboutimage"]["type"] == "image/gif") || ($_FILES["aboutimage"]["type"] == "image/GIF") || ($_FILES["aboutimage"]["type"] == "image/jpg") || ($_FILES["aboutimage"]["type"] == "image/JPG") || ($_FILES["aboutimage"]["type"] == "image/jpeg") || ($_FILES["aboutimage"]["type"] == "image/JPEG") || ($_FILES["aboutimage"]["type"] == "image/pjpeg") || ($_FILES["aboutimage"]["type"] == "image/PJEG") || ($_FILES["aboutimage"]["type"] == "image/png") || ($_FILES["aboutimage"]["type"] == "image/x-png") || ($_FILES["aboutimage"]["type"] == "image/PNG") || ($_FILES["aboutimage"]["type"] == "image/X-PNG"))
{
$filename=$_FILES['aboutimage']['name'];
preg_match("/\.([^\.]+)$/", $filename, $file_ext);
copy ($_FILES['aboutimage']['tmp_name'], "../uploadfile/aboutcover.".$file_ext[1])
or die ("Could not copy the file: About Image");
$aboutimage = "aboutcover.".$file_ext[1];
$aboutimage = htmlspecialchars($aboutimage,ENT_QUOTES);
}
else
{
// upload error
?>
<script language="javascript">
alert("Files must be BMP, JPEG, GIF, or PNG");
history.back();
</script>
<?php
exit;
}
}
else
{
$aboutimage = "";
}
// Modify
$sql = "update about set abouttitleen='$abouttitleen', aboutdescen='$aboutdescen', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' ";
if ($aboutimage <> '')
$sql .= ", aboutimage='$aboutimage' ";
$sql .= " where aboutid=". $aboutid ." ";
mysql_query($sql);
if( mysql_errno() > 0 ){
echo 'Modify About Us Error:<br />'. mysql_error() .'<br />SQL: '. $sql;
exit;
}
mysql_close($dbh);
header("Location: about_modifyform.php?id=$aboutid&msg=Modify Successful");
?>