i'm a little bit new for php so maybe this question is stupid.
say i have a form:
<form id="createNewGallery" name="newgallery" method="GET" action="code.php"><p><strong>please choose the number of pictures you want to upload:
</strong>
<select name="numOfPictures" id="numOfPictures">
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></p>
<input name="submitNumOfPictures" type="submit" />
</form>
by submiting this form i want to add afterwards another form, i know i can do it in this particular page but i just want my code not to be messy, so i want to do it in another page, say code.php
and this is the code:
<?php
if (isset($_GET['numOfPictures'])){
$times = $_GET['numOfPictures'];
for ($i = 1; $i <= $times; $i++){
echo '<br />select picture number '.$i.': <br />';
echo '<input name="file'.$i.'" type="file" />';
}
echo '</br><input name="submitFiles" type="submit" />';
}
the result im getting is an output in a new page, code.php, but i want it to create a form just afterwards the for i had on my index php.
i get the required result if i do mt php coding in the index page.