来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] 可获得认证码、数据库账号密码等。就用官方给的演示站做测试。不知道你们有没有小礼物呢? app controller downController php代码如下:class downController extends Controller{public function index()...
|
可获得认证码、数据库账号密码等。就用官方给的演示站做测试。不知道你们有没有小礼物呢? /app/controller/downController.php
class downController extends Controller{
public function index(){
$_GET['file']=strip_tags(base64_decode($_GET['file']));
if(file_exists(ROOT_PATH.$_GET['file'])){
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($_GET['file']));
readfile(ROOT_PATH.$_GET['file']);
}else{
echo '<script type="text/javascript">alert("您要下载的文件不存在!");history.back();</script>';
}
}
}
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com