Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn the thinkphp video tutorials recently downloaded! I saw thinkphp use a Baidu online drive for direct download, and I think it is very good! Using Baidu's powerful server to upload content from your website to Baidu, and then directly download the content from your website, which is required by many webmasters.
/* Save this code as bd. php.
Use the file_get_contents, preg_match_all, and str_replace functions!
Add the $ Region ID and $ uk of the Baidu online storage.
Example: http://pan.baidu.com/share/link? Consumer id = 489412 & uk = 101682133
Localhost/bd. php on your server? Upload id = 489412 & uk = 101682133 and you can download it by yourself.
*/
$ Region ID = $ _ GET ['region id'];
$ Uk = $ _ GET ['uk '];
If (isset ($ Region ID) & isset ($ uk ))
{
$ Str = file_get_contents ("http://pan.baidu.com/share/link? Consumer id = {$ consumer ID} & uk = {$ uk }");
Preg_match_all ('| "dlink \": \ "([^"] +) \ ", \" | imsU', $ str, $ baiduid );
$ Down = str_replace ("\", "", $ baiduid [1] [1]);
}
Header ("Location:". $ down );
?>
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB