Hello there :-) I coded a website in PHP that accepts images for upload. Normal stuf: click a file-type button in a form and wait. The thing is, i cannot seem to give feedback to the user. I would like to use PHP, CSS and HTML and Javascript only in this website.
I submit the form
<form name="form_2" action="" method="post" enctype="multipart/form-data">
<input type="file" name="work_image" />
</form>
And then the page reloads. The next statement is executed before reaching the html of he page (so before printing anything to the browser):
upload_image($_FILES, 'work_image');
All works well. However, uploading takes a while. I would like to show a message to the user, stating tha the file is being uploaded. There are various ways to do this, i guess. What would be the best (cleanest) solution?
I am thnking about:
1. <form name="form_2" action="upload.php".... where upload.php first echo's some HTML ('Please wait, uploading your image') and after that starts processing the imageupload and redirects to the target page after finishing
2. moving the 'upload_image($_FILES, 'work_image');' statement down untill after the <body> tag and have a div made visible/invisible that has the message in it
I must be overlooking something. Any suggestions?
Thanks a lot