what is the problem with this script, it jumps to else statement?
if(@move_uploaded_file($_FILES['complaint_file']['temp_name'], "../../stg/comp/".time().".".$exten))
{
$filename = time().".".$exten;
$insertSQL = sprintf("UPDATE complaints SET complaint_status='CLOSED', complaint_solved_date=NOW(), complaint_remark=%s complaint_filename=%s WHERE complaint_number=%s",
GetSQLValueString($_POST['complaint_remark'], "text"),
GetSQLValueString($_POST['confirm_close_complaint'], "text"),
GetSQLValueString($filename, "text"));
$Result1 = mysql_query($insertSQL, $dacreint) or die(mysql_error());
header('Location: complaint-register.php?ComplaintClose=Successful');
exit();
}
else {
header("Location: complaint-register.php?FileUploadError=1");
exit();
}
My upload folder is having 777 permission.
@operator and check your error log. You will get an error message then, which will tell you what went wrong. No need to guess.var_dump($_FILES)andecho "../../stg/comp/".time().".".$exten;.move_uploaded_file, it's just you decided to fly blind by using the@operator for a reason unknown to us. Please never again post code on this website that has the@operator in there. Thank you for making this easier!