Hi. I am making a file sharing website but don’t know how to get there to be the text after the file name (i.e. the text would say “uploaded by [username]”.
So far I have the key $_SESSION[‘Username’] but I don’t know how or where to add it to the upload script:
<?php $limit_size=2097152; $file_name = $HTTP_POST_FILES['ufile']['name']; $random_digit=rand(0000,9999); $new_file_name= $random_digit.$file_name; $path= "upload/".$new_file_name; if($ufile !=none) { $file_size=$HTTP_POST_FILES['ufile']['size']; if($file_size >= $limit_size){ echo "Your file size is over limit"; echo "Your file size = ".$file_size; echo " K"; echo "
File size limit = 2 gb"; } else { if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path)) { echo "Successful
"; echo "
Any help would be greatly appreciated.