PHPnewbie25
New Member
- Messages
- 17
- Reaction score
- 0
- Points
- 1
Hi I'm working on an upload process for my project and keep receiving this error:
Parse error: syntax error, unexpected T_ELSE in /home/mediaedi/public_html/roxanne/uploadprocess.php on line 29
The error is for the last ELSE that I have used could any of you explain to me why this is occurring, could there be too many ELSE's or am i missing some code, I'm fairly new to PHP sorry if its a dumb post
Parse error: syntax error, unexpected T_ELSE in /home/mediaedi/public_html/roxanne/uploadprocess.php on line 29
The error is for the last ELSE that I have used could any of you explain to me why this is occurring, could there be too many ELSE's or am i missing some code, I'm fairly new to PHP sorry if its a dumb post
PHP:
if (file_exists("fileupload/" . $newfilename))
{
echo "You have already uploaded this file.";
}
else
{
//old code below if it doesnt work add the if( to the m
if(move_uploaded_file($_FILES['myfile']['tmp_name'], $path . $newfilename)) //upload file
//$newfilename = rand(1,99999).end(explode(".",$_FILES["myfile"]["name"]));
//move_uploaded_file($_FILES["myfile"]["tmp_name"], "fileupload/" . $newfilename;
echo "$newfilename has been uploaded";
}
else //if an error occurred
{
/*header('Location: '.$redirect); */
echo "There was an error uploading the file, please try again!";
}