k1ngscorp1o Posted August 21, 2013 Share Posted August 21, 2013 I am looking for some advice from people with experience uploading to their website with custom scripts. I essentially want to make an uploader, members will be able to input their name, desc, and category and I was wondering I wan can make it so they can upload their thumbnail with it. Is the upload its own form inside of the main form, or how would that work? Also what if I wanted 2 upload spots in the form, so: name desc upload 1 upload 2 [submit] Then on submit the images are uploaded to their correct places and stored in the database all at the same time. I may just be over thinking it but looking upt uploading for a few hours not sure how id get it working as 1 form. Quote Link to comment Share on other sites More sharing options...
sniko Posted August 21, 2013 Share Posted August 21, 2013 (edited) With TopListedGames, I made use of the imgur api - it worked effectively! They return file information with JSON, once uploaded. Apart from that, have a look at these. With regards to the 'which form' issue, it depends how you want to handle it. I'd put it in the same form as everything else, if I were you. <form action="" method="post" class="form-horizontal" enctype="multipart/form-data"> <label>Name</label> <input type="text" name="name" /> <br /> <label>Description</label> <textarea name="desc"></textarea> <br /> <label>Upload 1</label> <input type="file" name="upload1" /> <br /> <label>Upload 2</label> <input type="file" name="upload2" /> <br /> </form> Then, just use the superglobal; $_FILES, and upload as you would by using predefined functions :) Edited August 21, 2013 by sniko Quote Link to comment 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.