ballouta Posted February 6, 2009 Share Posted February 6, 2009 Hi, i have this code that uploads a file. I want to store the file name in a avariable to update the table records.. how? Thank you <?php $target_path = "/home/username/public_html/files/"; $target_path = $target_path . basename($_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded<br> <a href='index.htm'> Go back to HOME</a><br>"; } else{ echo "There was an error uploading the file, please try again!<br><a href='index.htm'> Go back to HOME</a><br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/144042-solved-uploaded-file-name/ Share on other sites More sharing options...
gevans Posted February 6, 2009 Share Posted February 6, 2009 $filename = $_FILES['uploadedfile']['name']; Link to comment https://forums.phpfreaks.com/topic/144042-solved-uploaded-file-name/#findComment-755837 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.