PHP实现采集程序原理和简单示例代码
时间:2020-11-04 11:08:40|栏目:PHP代码|点击: 次
<entry SKIPIFREF="YES">
<title>I Believe In Love</title>
<author> 蓝牙音乐网 - 8391.com</author>
<copyright> 蓝牙音乐网 - 8391.com</copyright>
<ref href="http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv"/>
<param name="Artist" value="榭拉"/>
<param name="Album" value=" 蓝牙音乐网 - 8391.com"/>
<param name="Title" value="I Believe In Love"/>
</ENTRY>
</ASX>
确认有用数据:
歌曲名称:I Believe In Love
歌手:榭拉
歌曲路径:http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv
我们在小偷程序中只要得到以上数据就可以了
3、PHP代码编写
PHP:<?
/********
说明,为程序简单化,整个程序没有使用正则表达式
(我自己对这个方面也很臭,呵呵,高手别骂)
****/
//定义一个函数,对字符简单的过滤
function str($txt){
??? $txt= str_replace("'","'",$txt);
??? $txt= str_replace("\"","\\"",$txt);
??? return $txt;
}
//初始化程序
$magic_quotes_gpc = get_magic_quotes_gpc();
$register_globals = @ini_get('register_globals');
if(!$register_globals ││ !$magic_quotes_gpc) {
??? @extract(daddslashes($HTTP_POST_VARS));
??? @extract(daddslashes($HTTP_GET_VARS));
??? if(!$register_globals) {
??????? foreach($HTTP_POST_FILES as $key => $val) {
??????????? $$key = $val['tmp_name'];
??????????? ${$key.'_name'} = $val['name'];
??????????? ${$key.'_size'} = $val['size'];
??????????? ${$key.'_type'} = $val['type'];
??????? }
??? }
}
if (function_exists('set_time_limit') == 1 && @ini_get('safe_mode') == 0) {
??? @set_time_limit(1000);
}
//end
//为防止日后对方修改地址,把地址前部相同的提取出来
$host="http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk/";
if(!$action){
echo "<a href=\"t.php?action=start\">click here to start</a>";
die();
}else{
?$end=3488;//结束ID
?if(!$id││$id<1)$id=1;//默认ID编号
?$url="http://mtv.8391.com/Yxwen.asp?id=".$id;????
?$str=@file_get_contents($url);//读取页面代码
?if($str){
???//利用关键字符,分割代码
???$a1=explode("value=\"",$str);//value=\"来分割字符
???//取歌手名称
???$n1=explode("\"",$a1[1]);
???$ges=str(trim($n1[0]));
???//取歌曲名称
???$g1=explode("\"",$a1[3]);
???$name=str(trim($g1[0]));
???//取歌曲地址
??? $h1=explode("href=\"",$str);
?????$h2=explode("\"",$h1[1]);
?????$mtvurl= str(str_replace($host,"",trim($h2)));
???? //添加数据库
???? /********
???? 可根据自己的程序,适当的添加
???? ********/
?????
?}
?$id++;
?if($id<=$end){ echo "<a href=t.php?id=$id>cleck here </a>";
echo "<meta http-equiv=\"refresh\" content=\"0;url=t.php?id=$id\">";}
else?die("program runing over");?
}
?>
<title>I Believe In Love</title>
<author> 蓝牙音乐网 - 8391.com</author>
<copyright> 蓝牙音乐网 - 8391.com</copyright>
<ref href="http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv"/>
<param name="Artist" value="榭拉"/>
<param name="Album" value=" 蓝牙音乐网 - 8391.com"/>
<param name="Title" value="I Believe In Love"/>
</ENTRY>
</ASX>
确认有用数据:
歌曲名称:I Believe In Love
歌手:榭拉
歌曲路径:http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv
我们在小偷程序中只要得到以上数据就可以了
3、PHP代码编写
PHP:<?
/********
说明,为程序简单化,整个程序没有使用正则表达式
(我自己对这个方面也很臭,呵呵,高手别骂)
****/
//定义一个函数,对字符简单的过滤
function str($txt){
??? $txt= str_replace("'","'",$txt);
??? $txt= str_replace("\"","\\"",$txt);
??? return $txt;
}
//初始化程序
$magic_quotes_gpc = get_magic_quotes_gpc();
$register_globals = @ini_get('register_globals');
if(!$register_globals ││ !$magic_quotes_gpc) {
??? @extract(daddslashes($HTTP_POST_VARS));
??? @extract(daddslashes($HTTP_GET_VARS));
??? if(!$register_globals) {
??????? foreach($HTTP_POST_FILES as $key => $val) {
??????????? $$key = $val['tmp_name'];
??????????? ${$key.'_name'} = $val['name'];
??????????? ${$key.'_size'} = $val['size'];
??????????? ${$key.'_type'} = $val['type'];
??????? }
??? }
}
if (function_exists('set_time_limit') == 1 && @ini_get('safe_mode') == 0) {
??? @set_time_limit(1000);
}
//end
//为防止日后对方修改地址,把地址前部相同的提取出来
$host="http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk/";
if(!$action){
echo "<a href=\"t.php?action=start\">click here to start</a>";
die();
}else{
?$end=3488;//结束ID
?if(!$id││$id<1)$id=1;//默认ID编号
?$url="http://mtv.8391.com/Yxwen.asp?id=".$id;????
?$str=@file_get_contents($url);//读取页面代码
?if($str){
???//利用关键字符,分割代码
???$a1=explode("value=\"",$str);//value=\"来分割字符
???//取歌手名称
???$n1=explode("\"",$a1[1]);
???$ges=str(trim($n1[0]));
???//取歌曲名称
???$g1=explode("\"",$a1[3]);
???$name=str(trim($g1[0]));
???//取歌曲地址
??? $h1=explode("href=\"",$str);
?????$h2=explode("\"",$h1[1]);
?????$mtvurl= str(str_replace($host,"",trim($h2)));
???? //添加数据库
???? /********
???? 可根据自己的程序,适当的添加
???? ********/
?????
?}
?$id++;
?if($id<=$end){ echo "<a href=t.php?id=$id>cleck here </a>";
echo "<meta http-equiv=\"refresh\" content=\"0;url=t.php?id=$id\">";}
else?die("program runing over");?
}
?>