| 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");
$contactid = $_POST["contactid"];
$contacttitleen = htmlspecialchars($_POST["contacttitleen"],ENT_QUOTES);
$contactdescen = preg_replace("/'/","\'",$_POST["contactdescen"]);
$nowdate = date("Y-m-d H:i:s");
//print_r($_POST);
if ($_FILES['contactimage']['name'] <> '')
{
if (($_FILES["contactimage"]["type"] == "image/bmp") || ($_FILES["contactimage"]["type"] == "image/BMP") || ($_FILES["contactimage"]["type"] == "image/gif") || ($_FILES["contactimage"]["type"] == "image/GIF") || ($_FILES["contactimage"]["type"] == "image/jpg") || ($_FILES["contactimage"]["type"] == "image/JPG") || ($_FILES["contactimage"]["type"] == "image/jpeg") || ($_FILES["contactimage"]["type"] == "image/JPEG") || ($_FILES["contactimage"]["type"] == "image/pjpeg") || ($_FILES["contactimage"]["type"] == "image/PJEG") || ($_FILES["contactimage"]["type"] == "image/png") || ($_FILES["contactimage"]["type"] == "image/x-png") || ($_FILES["contactimage"]["type"] == "image/PNG") || ($_FILES["contactimage"]["type"] == "image/X-PNG"))
{
$filename=$_FILES['contactimage']['name'];
preg_match("/\.([^\.]+)$/", $filename, $file_ext);
copy ($_FILES['contactimage']['tmp_name'], "../uploadfile/contactcover.".$file_ext[1])
or die ("Could not copy the file: Contact Image");
$contactimage = "contactcover.".$file_ext[1];
$contactimage = htmlspecialchars($contactimage,ENT_QUOTES);
}
else
{
// upload error
?>
<script language="javascript">
alert("Files must be BMP, JPEG, GIF, or PNG");
history.back();
</script>
<?php
exit;
}
}
else
{
$contactimage = "";
}
// Modify
$sql = "update contact set contacttitleen='$contacttitleen', contactdescen='$contactdescen', modifyday='$nowdate', cmsloginid='".$_SESSION['cmsloginid']."' ";
if ($contactimage <> '')
$sql .= ", contactimage='$contactimage' ";
$sql .= " where contactid=". $contactid ." ";
mysql_query($sql);
if( mysql_errno() > 0 ){
echo 'Modify Contact Us Error:<br />'. mysql_error() .'<br />SQL: '. $sql;
exit;
}
mysql_close($dbh);
header("Location: contact_modifyform.php?id=$contactid&msg=Modify Successful");
?>