Jump to content

Recommended Posts

Hi Guys,

 

i have a page where users can select 1-5, this indicates how many files they want to upload, im used to just dealing with 1 upload at a time, i was wondering how i would go about inputting multiple entries into mysql also my input name will be different i take it aswell eh currently its:

 

echo '<form method="POST" action="uploadnzb.php"> 
           <p> 
           <select name="uploadsneeded"> 
           <option value="1">1</option> 
           <option value="2">2</option> 
           <option value="3">3</option> 
           <option value="4">4</option> 
           <option value="5">5</option> 
           </select><input type="submit" name="upsneeded" value="Upload!" /><br /><br />  

 

then the upload code part of:

 

<?php   
                ## how many files ######################################################## 
                for($n=0; $n < $neededfiles; $n++) {  
                             
                echo '<input type="hidden" name="need_1" value="'.$neededfiles1.'"><input type="file" name="files1"><br />'; 
                 
                }                 
?> 
                </td> 
                </tr> 
                <tr> 
                <td align="right" /><b>RAR/ZIP</b></td><td align="left"> 
<?php 

                for($i=0; $i < $uploadsneeded; $i++){ 

                echo '<input type="hidden" name="need_2" value="'.$uploadsneeded.'"><input type="file" name="files2" ><br />'; 

                }  
?> 

 

depending on what the user select thats how many upload fields are displayed, would i need to loop them into mysql? not to sure what i need to do next lol

 

thanks for nay help guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/66740-advice-on-multiple-uploads-into-mysql/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.