Why not do it this way ...
Upload the file - then use header(location.....) to go to whichever page you want with the $message variable set...
When the page you want opens, if($message){echo $message;} which will let them know if it was successful or not.
This avoids the need for an intermediate page, as well as the outputting of anything before the headers which would make the page crash...