9. 前几天写了一个自用,用的拼凑法弄的下载地址:
<?php
header("Content-type: text/html; charset=utf-8");
Require "http.class.php";
$f=new httplib;
$url=$_GET['url'];
$url=$url2=str_ireplace("http://","",$url);
$url="http://".$url;
$f->open($url);
$f->send();
$m=$f->response();
preg_match('!<title>(.*)</title>!i',$m,$x);
$title=$x[1];//标题
preg_match('!文件大小:(.*?)</p>!is',$m,$n);
//print_r($n);
$size=$n[1];//文件大小
preg_match('!上传时间:(.*?)</p>!is',$m,$v);
//print_r($v);
$time=$v[1];//时间
$url3=explode("/",$url2);
$tou=$url3[0];
$n=end($url3);
$date=date("Ymd");
$downurl="http://{$tou}/down/{$date}/{$n}/{$title}";
echo "文件:{$title}<br/>上传日期:{$time}<br/>文件大小:{$size}<br/>下载地址:<a href={$downurl}>下载</a>";
?>