Different labels for input file types in PHP/HTML -


i've simple problem can't seem fix :( .

i have following php variable:

$nrofattachments="2";  

and in html code i've show number of file upload fields:

<?for($i=1;$i <= $nrofattachments; $i++) {?>    <div class="form-group">       <label for="attachments" class="control-label">attachment(s)</label>       <input name="attachment[]" type="file" id="attachments" size="30"/>    </div> <?}?>  

what want achieve different labels each input file type...

<?   for($i=1;$i <=$nrofattachments; $i++)   {       echo '<div class="form-group">       <label for="attachments['.$i.']" class="control-label">attachment '.$i.'</label>       <input name="attachment['.$i.']" type="file" id="attachments['.$i.']" size="30"/>       </div>';   } ?> 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -