I have two files which is index.php and upload.php
In index I have a browse button and a submit button. If I click the submit button, it will direct to a new web page and show the uploaded file name and size.
All of this works.
Now I want to show the uploaded file name and size on the same web page as the browse and submit button.
Code: Select all
print('<table>');
print('<tr><td width=100px>File Name</td><td>File Size</td></tr>');
print('<tr><td>'. $_FILES['uploadedfile']['name'] . '</td><td>'. round($_FILES['uploadedfile']['size']/1024,4) . ' Kb</td></tr>');
print('</table>');Code: Select all
<form name="upload" method="POST">
<input type=hidden name=MAX_FILE_SIZE value=500000>
<input type=file name=uploadedfile>
<input type=submit name="upload" value=Upload>
</form>Code: Select all
<?php
if(!empty($_POST['upload']))
{
//All the code for upload file including the table containing uploadedfile name and size
}
?>