Home > Backend Development > PHP Tutorial > Relatively simple Baidu Netdisk file direct link PHP code_PHP tutorial

Relatively simple Baidu Netdisk file direct link PHP code_PHP tutorial

WBOY
Release: 2016-07-21 15:12:26
Original
1013 people have browsed it

Baidu network disk is fast and stable. You deserve it. If direct connection is supported in the future, you can directly use Baidu network disk.

The solution provided here is a temporary solution and is not guaranteed to work in the future

Save the following code as downbd.php

Copy the code The code is as follows:

$canshu=$_SERVER["QUERY_STRING"];
if($canshu=="")
{
die("File does not exist");
}
else
{
$wangzhi="http://pan.baidu.com/share/link?".$canshu;
$file=file_get_contents($wangzhi);
$pattern='/a>/i';
preg_match_all($pattern,$file,$result);
$tempurl=implode("",$result[1]);
$fileurlt=str_replace(""","",$tempurl );
$fileurl=str_replace("&","&",$fileurlt);
header("location:$fileurl");
}
?>


Calling method:

http://***/downbd.php?shareid=00000&uk=00000
Mainly?shareid=00000&uk=00000 This format

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326719.htmlTechArticleBaidu Netdisk is fast and stable. You deserve it. If it supports direct connection in the future, you can use it directly. Baidu’s network disk. The solutions provided here are temporary solutions and are not guaranteed in the future...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template