zimmo Posted October 18, 2007 Share Posted October 18, 2007 I am unusre of the correct syntax for prefixing the following so it includes the category from another field. I need the following: if(empty($_FILES['file_name']['name'])) { $file_name = $old_file_name; } else { $file_name = $_FILES['file_name']['name']; To be able to have the category value in the file name at the start, so prefixing the actual image file name. ie: $category,$_FILES... Quote Link to comment https://forums.phpfreaks.com/topic/73802-prefix-a-file-upload/ Share on other sites More sharing options...
MadTechie Posted October 18, 2007 Share Posted October 18, 2007 $prefix = "Blar_"; if(empty($_FILES['file_name']['name'])) { $file_name = $prefix.$old_file_name; } else { $file_name = $prefix.$_FILES['file_name']['name']; } Quote Link to comment https://forums.phpfreaks.com/topic/73802-prefix-a-file-upload/#findComment-372338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.