I want to echo a message reading “file uploading” while the file is uploading but the message is only being echoed after it has finished uploading, is there another way of dong this?
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "file uploading";
header("location:somewhere.php?uploaded")
}
else echo "oops!";
What you are encountering right now is the necessity to do something asynchronously. Synchronous is what you are doing right now, i.e. firing a new request and thereby uploading the picture, which only allows showing the message after the request.
You can upload the image in the background and display a loading gif or something like that on the page using AJAX and jQuery. This allows you to show the message while uploading.
For a good introduction to jQuery, check these videos from the new boston. Specifically for AJAX, check out episode 101 and following.