PHP implementation of the acquisition program principle and simple example code _php instance

Source: Internet
Author: User
Tags explode
<entry skipifref= "YES" >
<title>i believe in love</title>
<author> Bluetooth Music Network-8391.com</author>
<copyright> Bluetooth Music Network-8391.com</copyright>
<ref href= "http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv"/>
<param name= "Artist" value= "The Champs-La"/>
<param name= "Album" value= "Bluetooth Music Network-8391.com"/>
<param name= "Title" value= "I Believe in Love"/>
</ENTRY>

</ASX>

Confirm Useful data:
Song name: I Believe in love
Singer: the Champs
Song Path: http://218.78.213.183:880/daolianmtvfuc__________________kkkkkkkkkk//shela_believe.wmv
We can only get the above data in the Thief program.
3, PHP code writing
php:<?
/********
Description, for the program simplification, the entire program does not use regular expressions
(my own on this aspect also very smelly, hehe, master don't scold)
****/
Define a function to filter the characters simply

function str ($txt) {
 $txt = Str_replace ("'", "'", $txt);
 $txt = str_replace ("\", "\ \", $txt);
return $txt;
}
Initialization program
$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
In order to prevent the other side to modify the address, the address of the same before the same extraction
$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;//End ID
if (! $id ││ $id <1) $id =1;//default ID number
 $url = "http://mtv.8391.com/Yxwen.asp?id=". $id; 
 $str = @file_get_contents ($url);//Read page code
if ($STR) {
//uses key characters to split code
 $a 1=explode ("value=\" ", $str);//value=\" to split the characters
//Name of the singer
 $n 1=explode ("\" ", $a 1[1]);
 $ges =str (Trim ($n 1[0]));
//Song name
 $g 1=explode ("\" ", $a 1[3]);
 $name =str (Trim ($g 1[0]));
//Song Address
 $h 1=explode ("href=\", $str);
 $h 2=explode ("\" ", $h 1[1]);
 $mtvurl = str (str_replace ($host, "", Trim ($h 2));
//Add a database
/********
 can be added according to their own procedures, appropriate
********/


 $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"); 
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.