Jump to content

Adding submit button for each file download in loop statement...


AshleyQuick

Recommended Posts

I've butchered this...I can't figure out how to implement the submit (Go) button for each.  Can someone assist?

 

<table align="center" bgcolor="#8BA5C5" border="0" cellpadding="4" cellspacing="0" width="760">
  <form name="dodownload" method="post" action="download.php">
  <tr> 
    <td align="center"><strong>Download Backup</strong></td>
  </tr>
  <tr> 
    <td align="center"> 
    <?php
     $farr=array();
     if (file_exists($url_base."_BACKUPS/")) {
        $dir= opendir($url_base."_BACKUPS/"); 
        $fl = readdir($dir);
        while ($fl = readdir ($dir)) { 
           if ($fl != "." && $fl != ".." &&  (eregi("\.gz",$fl))){ 
              $farr[]=$fl;
           }
        } 
        closedir($dir); 
     }
sort($farr);
     if (sizeof($farr) == 0) 
{
    ?> 
<p>No backup found  </p>
<?php
}
else
{
$i = 0;
foreach($farr as $file)
{
?>
      File to download:  
      <input name="zipname<?php echo $i; ?>" type="text" value="<?php echo $file; ?>"><br>
<?php
}
$i++;
}
?>
</td>
  </tr>
  <tr> 
    <td align="center">
      <input type="hidden" name="path" value="<?=$url_base;?>">
      <input name="send4" type="submit" class="textbox" value="Go">
    </td>
  </tr>
  </form>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.