I tried my best researching on how to pass an input type file array to another php page. But I get stuck everytime I post the value from one page to the other.
I have this code written on the page cityaddinfo.php which on submits directs to the page cityadded.php
<form method="POST" action="cityadded.php?city=<?php echo $city?>">
<tr>
<td>
<?php
$quecityimage=mysql_query("SELECT * FROM `city_image` WHERE city_id=$city");
echo "<b>city images</b><br>";
while($cityimage=mysql_fetch_assoc($quecityimage))
{
$pathcity=$cityimage['path'];
echo "<img src='$pathcity' width=\"400px\" height=\"200px\"/><br><br>";
}
?>
</td>
</tr>
<tr>
<td>
<p class="clone"> File:
<input type="file" name="f_name[]" size="10" style="font-family: arial; font-size: 22px;"/>
<p>
<a href="#" class="add" rel=".clone">Add More</a>
</p>
</td>
</tr>
<tr>
<td>
<input type="submit" value="submit" name="submit">
</td>
</tr>
cityadded.php code:
<?php
echo $_GET['city'];
if(isset($_POST['submit']))
{
$a= $_POST['f_name'];
foreach($a as $img)
{
echo $img;
}
}
?>
The code echo's the name of only one input type file name. Even if I add more than one files. Can anybody help me out on how to post this input file array on other page? Thanks in advance :)