mpsn Posted November 10, 2011 Share Posted November 10, 2011 Hi, I want to let users upload multiple images to my online picture book, so after they press submit, HOW do I count the total $_FILES[someName]['name'] uploaded. I want to allow users to type in html form the total uploads they want and this will then display that many desired upload forms. I'm going to try count($_FILES[][]) and go from there first... Any help much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/ Share on other sites More sharing options...
cypher86 Posted November 10, 2011 Share Posted November 10, 2011 it depends how you permit to upload the files. if you do it with multiple textboxes you can count it.. Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286986 Share on other sites More sharing options...
mpsn Posted November 10, 2011 Author Share Posted November 10, 2011 I'm not sure what you mean, please elaborate, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286988 Share on other sites More sharing options...
cypher86 Posted November 10, 2011 Share Posted November 10, 2011 i'll elaborate once you tell my in which way you allow the upload. Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286992 Share on other sites More sharing options...
mpsn Posted November 10, 2011 Author Share Posted November 10, 2011 I have 10 upload forms, so how do I count which one's have files uploaded to them b/c don't they all have different names as in: <input type='file' name='uploadA' > etc There is user logging in so only each user can upload to their online album. Any help much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286994 Share on other sites More sharing options...
cypher86 Posted November 10, 2011 Share Posted November 10, 2011 you could check if a specific textbox is valorized. if it is ++count Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286997 Share on other sites More sharing options...
mpsn Posted November 10, 2011 Author Share Posted November 10, 2011 Sorry, what text box? Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1286998 Share on other sites More sharing options...
cypher86 Posted November 10, 2011 Share Posted November 10, 2011 i meant something like: if(isset($_POST['uploadA']) and $_POST['uploadA']!="") count++; Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1287001 Share on other sites More sharing options...
mpsn Posted November 10, 2011 Author Share Posted November 10, 2011 I was hoping there was a less redundant/hard coded way, b/c I want to change it so that user can type in how many images to upload, so then there would no way to use the method you showed me, but I guess I'll stick with 10 uploads and figure it out later, thanks though. Hey, if you are good with mysql, can you also take a look at my other post: http://www.phpfreaks.com/forums/index.php?topic=347404.0 Any help is much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/250852-how-to-count-total-file-uploads/#findComment-1287002 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.