Home > php教程 > PHP源码 > 百度网盘文件直链

百度网盘文件直链

PHP中文网
Release: 2016-05-25 17:08:33
Original
3035 people have browsed it

[PHP]代码   

<?php
$canshu=$_SERVER["QUERY_STRING"];
if($canshu=="")
 {
 die("文件不存在");
 }
else
{
$wangzhi="http://pan.baidu.com/share/link?".$canshu;
$file=file_get_contents($wangzhi);
$pattern=&#39;/a><a class="dbtn cancel singledbtn" href=(.*?)id="downFileButtom">/i&#39;;
preg_match_all($pattern,$file,$result);	
$tempurl=implode("",$result[1]);
$fileurlt=str_replace("\"","",$tempurl);
$fileurl=str_replace("&amp;","&",$fileurlt);
header("location:$fileurl");
}
?>
Copy after login

                                                                       

2. [图片] 效果               

百度网盘文件直链

                                           

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template