我该如何在其上创建下载按钮?

时间:2017-01-15 19:48:59

标签: php download download-manager

//a table to display file from the database
         <thead class="thead-inverse">  
         <tr>  
          <th>Description </th>
          <th>Category</th>
          <th>Upload By</th>
          <th>Date</th>
          <th></th> 
         </tr>  
         <thead>  
         <tbody class="sc">  
         <?php  
// fetch the records from db
       while ($row = mysql_fetch_assoc($result)) {  
                     ?>  
        <tr>  
             <td><?php echo $row['fdesc']; ?></td> //filename
         <td><?php echo $row['category']; ?></td>
         <td><?php echo $row['username']; ?></td> //user who have upload the file
        <td><?php echo $row['fdatein']; ?></td>
//the download button  
        <td><a href="" ><button type="button" class="btn btn-unique active" data-toggle="tooltip" data-placement="right" title="Download"><i class="fa fa-download"></i> // get the specific to download
                </button></a></td> 
        </tr>  
         <?php  
         }  
         ?>  
         </tbody>  
         </table>

1 个答案:

答案 0 :(得分:1)

您可以在链接网址中添加ID,如下所示:

<div fxLayout="column">
  <div fxLayout="row" fxFlex="90%">
    <div fxFlex="80%" class="border">
      <p>Stuff is happening here</p>
    </div>
    <div fxFlex="20%" class="border">
      <ul>
        <li>Item 1</li>
        <li>Item 2</li>
      </ul>
    </div>
  </div>
  <div fxLayout="row" fxFlex="10%" class="border">
    <p>Bottom element</p>
  </div>
</div>

然后在d1.php中,id将在变量<a href="d1.php?fileId=<?php echo $row['fileID']; ?>" >