How PHP implements the collection program and simple example code _ php instance
Source: Internet
Author: User
Principles and simple sample code of the PHP collection program
I Believe In Love
Bluetooth music network-8391.com
Bluetooth music network-8391.com
Confirm useful data:
Song name: I Believe In Love
Artist: Karla
Song path: http: // 218.78.213.183: 880/daolianmtvfuc ______________ kkkkkkkkkk // shela_believe.wmv
We only need to get the above data in the thief program.
3. PHP code writing
PHP: /********
Note: The program is simple and the whole program does not use regular expressions.
(I am also very bad at this aspect. Oh, don't scold me)
****/
// Define a function to simply filter characters
Function str ($ txt ){
$ Txt = str_replace ("'", "'", $ txt );
$ Txt = str_replace ("\" "," \ "", $ txt );
Return $ txt;
}
// Initialize the 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
// To prevent the recipient from modifying the address in the future, extract the same address from the front.
$ Host = "http: // 218.78.213.183: 880/daolianmtvfuc ______________ kkkkkkkkkk /";
If (! $ Action ){
Echo "click here to start ";
Die ();
} Else {
$ End = 3488; // end ID
If (! $ Id │ $ id <1) $ id = 1; // default ID
$ Url = "http://mtv.8391.com/Yxwen.asp? Id = ". $ id;
$ Str = @ file_get_contents ($ url); // read the page code
If ($ str ){
// Use key characters to separate code
$ A1 = explode ("value = \" ", $ str); // value = \" to separate characters
// Name the singer
$ N1 = explode ("\" ", $ a1 [1]);
$ Ges = str (trim ($ n1 [0]);
// Obtain the song name
$ G1 = explode ("\" ", $ a1 [3]);
$ Name = str (trim ($ g1 [0]);
// Obtain the song address
$ H1 = explode ("href = \" ", $ str );
$ H2 = explode ("\" ", $ h1 [1]);
$ Mtvurl = str (str_replace ($ host, "", trim ($ h2 )));
// Add a database
/********
You can add
********/
}
$ Id ++;
If ($ id <= $ end) {echo "cleck here ";
Echo" ";}
Elsedie ("program runing over ");
}
?>
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