hi everyone, I keep getting the following error when I try to open up an uploaded file.
Fatal error: Function name must be a string in /home/********/public_html/upload_file.php on line 42
I want to use $fgetcsv() on it but I can't seem to pass a proper argument to it. here is my code
/*save the file on the server since by default PHP deletes file on script exit*/
if ($_FILES["file"]["error"] > 0){
echo "<h2>File upload error; Return Code: " . $_FILES["file"]["error"];
echo " Please contact your IT admin </h2>";
exit();
}
/*verify to make sure it doesn't exist already*/
if (file_exists("_Uploaded/" . $_FILES["file"]["name"])){
echo "<h2> the file " . $_FILES["file"]["name"] . " already exists." .
" Please rename and upload again</h2>";
exit();
}
else{ /*save uploaded file locally in folder for it */
move_uploaded_file($_FILES["file"]["tmp_name"],
"_Uploaded/" . $_FILES["file"]["name"]);
echo "<h2>Thank you the file: " . $_FILES["file"]["name"];
echo " was successfully uploaded and accepted</h2>";
}
[color="red"]/*open the file for reading so we can work on it*/
$uploadedFile = "_Uploaded/" . $_FILES["file"]["name"];
$fileResource = $fopen($uploadedFile,'r');[/color]