0
<? $fileUpload=3 ; for($i=0;i<$fileUpload;$i++) { ?>
    <input type="file" name="upload_file" value="" id=" " />
<? } ?>

I want to actually generate three file upload field based on the loop, but this code is not working.

Actual requirement

On the click of the browse button, if the file is selected... the next field of form should appear... automatically and so on.

John Cooper
  • 7,343
  • 31
  • 80
  • 100

1 Answers1

1
<?php $fileUpload=3 ; for($i=0;$i<$fileUpload;$i++) { ?>
    <input type="file" name="upload_file" value="" id=" " />
<?php } ?>

You needed to change "i" to "$i" in your break condition.

Also don't get into the habit of short PHP opening tags: Link

Community
  • 1
  • 1
Gunnar Hoffman
  • 1,226
  • 1
  • 11
  • 11