美文网首页
拼接下载路径并下载,与html搭配

拼接下载路径并下载,与html搭配

作者: 孤岛渔夫 | 来源:发表于2017-01-22 15:16 被阅读0次
    <?php 
    $filename = $_GET['name'];

    // 拼接下载路径
    $filepath = './down/'.$filename;

    header('content-Disposition:attachment; filename="'.$filename.'"');
    readfile($filepath);

 ?>
 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <a href="4.download.php?name=Meinv014.jpg">美女14号 ¥2</a>
    <a href="4.download.php?name=Meinv015.jpg">美女15号 ¥2.5</a>
    <a href="4.download.php?name=Meinv016.jpg">美女16号 ¥2500000000</a>
</body>
</html>

相关文章

网友评论

      本文标题:拼接下载路径并下载,与html搭配

      本文链接:https://www.haomeiwen.com/subject/pylobttx.html