I am using the below php code:
<?php
$str = time().'_'.$_FILES["file1"]["name"];
$fileName = $_FILES["file1"]["name"];
$fileTmpLoc = $_FILES["file1"]["tmp_name"];
$fileType = $_FILES["file1"]["type"];
$fileSize = $_FILES["file1"]["size"];
$fileErrorMsg = $_FILES["file1"]["error"];
if (!$fileTmpLoc) {
echo 'ERROR: Please browse for a file before clicking the upload button.';
exit();
}
if(move_uploaded_file($fileTmpLoc, "upload/" . $str)){
echo "$fileName upload is complete";
} else {
echo 'move_uploaded_file function failed';
}
?>
to upload a file on a server. I am altering the filename and keeping it in $str. My question is:
When the upload is completed I want to be able in my html file to print a message like
You uploaded <?php echo $str; ?>
How can I do that? How can I access $str ? Shall I use sessions? Any hint? Thank you a lot in advance...