Actually, now Im getting a 404 page when the script executes with that in the opening page.
the last "line" is to redirect to another page after upload, so i have
header("Location: admin_employee.php");
And that's what was giving the error , only because the upload script wasn't "moving" the uploaded file from "the unknown" tmp directory to the directory where I need the image.
//The file to be uploaded
$tmpfile = "images/emps/".$myfile_name;
if(!file_exists($tmpfile)) {
move_uploaded_file($_FILES['myfile']['tmp_name'], $tmp_name);
} else {
unlink($tmpfile);
move_uploaded_file($_FILES['myfile']['tmp_name'], $tmp_name);
}
//Update the database table for the new record
$uSQL = "update emps set picture='$myfile_name' where emp_id=".get_param("emp_id");
$db->query($uSQL);
// Redirect the user to the admin_employees.php page
header("Location: admin_employee.php");
this error is driving me nuts:
Warning: Unable to create '': No such file or directory in /var/www/html/employee/admin_picupload.php on line 24
Warning: Unable to move '/tmp/phphgq90X' to '' in /var/www/html/employee/admin_picupload.php on line 24
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/employee/admin_picupload.php:24) in /var/www/html/employee/admin_picupload.php on line 35
( the last line is that header() redirect line)
AND I dont know why it WAS working yesterday, when matt first gave the code, but after I closed down the browsers, and went back to it, it doesn't work.