php
set_time_limit(0);
mysql_connect(localhost,root,);
mysql_select_db(music_36g);
$ip = '127.0.0.1';
function _getip()
{
$ip = getenv(remote_addr);
$ip1 = getenv(http_x_forwarded_for);
$ip2 = getenv(http_client_ip);
($ip1) ? $ip = $ip1 : null ;
($ip2) ? $ip = $ip2 : null ;
return $ip;
}
function makepassword($length=10)
{
$password = '';
$chars =
array
(
1,2,3,4,5,6,7,8,9,0,
a,a,b,b,c,c,d,d,e,e,f,f,g,g,h,h,i,i,j,j,
k,k,l,l,m,m,n,n,o,o,p,p,q,q,r,r,s,s,t,t,
u,u,v,v,w,w,x,x,y,y,z,z
);
$count = count($chars) - 1;
srand((double)microtime()*1000000);
for($i = 0; $i $length; $i++)
{
$password .= $chars[rand(0, $count)];
}
return($password);
}
if ( _getip() != $ip )
{
exit(can't run!);
}
for ( $i=2;$i5769;$i++)//52738
{
$url = http://music.36g.net/specialinfo/showspecial.$i..htm;
$file = @fopen($url,'rb');
if ( $file )
{
$makefile = $buffer = ;
$buffer = ;
while ($buffer = fread($file,4096))
{
$makefile = $makefile.$buffer;
}
@fclose($file);
preg_match(/src=\/uppic\/(.*) width=135/,$makefile,$pic);#图片
#下载图片
if ( $pic[1]!='es/nophoto.gif' )
{
$p_url = http://music.36g.net/uppic/.$pic[1];
$file2 = fopen($p_url,'rb');
if ( $file2 )
{
$buffer2 = $makefile2 = ;
while ($buffer2 = fread($file2,4096))
{
$makefile2 = $makefile2.$buffer2;
}
fclose($file2);
$filename2 = './pic/'.$pic[1];
$fp2 = fopen ($filename2,'w+');
fwrite($fp2,$makefile2);
fclose($fp2);
}
}
else
{
$pic[1] = '';
}
preg_match(/专辑:(.*)
