Ok so I have a form, where I am taking an amount of entries from admin_images and sending that value to the second page (i'll probably tweak the first page, but thats not what im worried about here)

1st step, I need the hidden divs to be included in the loops, so that each browse field gets its own radio group AND the hidden divs.

I would appreciate any help


admin_images.php (added for sake of code uniformity)

<div class="middle" align="center">Admin Images<BR><BR>	How many Pictures to do wish to add?<BR>
  
	<form name="form1" enctype="multipart/form-data" method="post" action="admin_images2.php">
	<select name="uploadNeed">
	<option>1 - One</option>
	<option>2 - Two</option>
	<option>3 - Three</option>
	<option>4 - Four</option>
	<option>5 - Five</option>
	<option>6 - Six</option>
	<option>7 - Seven</option>
	</select>
	 <input type="submit" name="Submit" value="Submit">
<form name="form1" enctype="multipart/form-data" method="post" action="processFiles.php"></code>

  <?php
  // start of dynamic form
  $uploadNeed = $_POST['uploadNeed'];
  for($x=0;$x<$uploadNeed;$x++){
  ?>
   <input name="uploadFile<?php echo $x;?>" type="file" id="uploadFile<?php echo $x;?>"><BR>  
   <INPUT TYPE="RADIO" NAME="radio" value="seasons" onclick="document.getElementById('seasons').style.display='block'; document.getElementById('products').style.display='none'; return true; document.getElementById('images').style.display='none';return true;" />Seasons<BR>
   <INPUT TYPE="RADIO" NAME="radio" value="products" onclick="document.getElementById('seasons').style.display='none';  document.getElementById('products').style.display='block';return true; document.getElementById('images').style.display='none';return true;" />Products<BR>
   <INPUT TYPE="RADIO" NAME="radio" value="images" onclick="document.getElementById('seasons').style.display='none';  document.getElementById('products').style.display='none'; return true; document.getElementById('images').style.display='none';return true;" />Images<BR> <br>
    <div id="seasons" style="display:none;">
    <?php include('includes/seasons.php'); ?>
	</div>
	
	<div id="products" style="display:none;">
    <?php include('includes/products.php'); ?>
	</div>
  <?php
  // end of for loop
  }
  ?>
  <input name="uploadNeed" type="hidden" value="<?php echo $uploadNeed;?>">
  <input type="submit" name="Submit" value="Submit">

<BR><BR>
	
</form>

theres probably a better more efficient way of doing this, lol... but it ended up just being something i could easily access

honestly, maybe it WOULD be better to write it as a function or something, that way I can just call to it.

also, the only reason "Image" has an onclick, is so that it clears the other 2, the idea being that the user clicks seasons, then selects an actual season, then uploads his pictures to said category (same with the products) but just flat out images doesnt NEED a sub category

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.