Teach you 20 lines PHP code to write thieves

Source: Internet
Author: User
Keywords Network programming PHP tutorial
Tags automatic class code content content filtering download echo functions

PHP thief program is the predecessor of the acquisition, with the thief principle will write acquisition. This is PHP100 Year En IT education and training for everyone to stay in class for homework. Written a few lines about ideas and functions, the details required to collect the inside of the mailbox, author, title, content filtering, automatic image download, storage classification and other functions, but also for your reference:

index.php

<? php

$ con = file_get_contents ("http://it.sohu.com/s2010/5651/s274087241/index.shtml");
$ preg = "/ · <a href=(.*) target=_blank> (. *) </a> / U";
preg_match_all ($ preg, $ con, $ arr);
foreach ($ arr [1] as $ id => $ v) {
echo "<a href=view.php?url=$v>". $ arr [2] [$ id]. "</a> <br>";
}
?>

view.php

<? php

$ con = file_get_contents ($ _ GET [url]);
$ preg = "/ <h1> (. *) </ h1> /";
preg_match ($ preg, $ con, $ arr);
echo "<h1>". $ arr [1]. "</ h1>";
echo "<hr>";
$ preg2 = "/ <div class =" text clear "id =" contentText "collection =" Y "> (. *) </ div> / s";
preg_match ($ preg2, $ con, $ arr2);
echo $ arr2 [1];

?>

Related Article

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.