With me. Successful theft of the program Home (third day) _php Foundation

Source: Internet
Author: User

Today we teach, steal the home page. Different home pages require different methods of stealing, mainly analysis of HTML code. Functions and methods The previous 2 days are very clear. Today we explain and use in practice.

Or take the Chinese Army Software Park surgery.
Open the Chinese Army Software Park homepage
Http://www.onlinedown.net/index.htm
Create a new index.php page with Dreamweaver.
Attention:
First you want to do the first page template, and then start to steal the home page. Due to the tutorial on beginners. So put the template and the PHP processing code on the same page.
I'll teach you the separation of HTML and PHP.

When the template is established, we steal it.
In Inserts the PHP code above the following form:
?
Require './commom.php ';
Update ("index.htm");
$file =readfromfile ("cache/index.htm");

?>
Explain
Require './commom.php '//introduction of commom.php File
Update ("index.htm")/Read write to index.htm Web page
Read from local folder cache $file =readfromfile ("cache/index.htm")//Index.htm
The $file here is a variable that you can name casually. You can call it $html
But you need to unify when you use it later.

The code above does not handle anything, nor does it output anything. If you say output $file, then it's all index.htm HTML code.
The following is the beginning of the index.htm to take what we want.

1 to take the Foreign software update code.
You can take a variable named $GWRJ//foreign software name casually pick
How to get out of this index.htm the foreign software we want? Here's the cut function we talked about in the last section.
$GWRJ = Cut ($file, "<td width=\" 307\ "height=\" 118\ ">", "</TD>");
Explain
$xxx = Cut ($file, "$first", "$end");
How to work? is to cut the $file (index.htm) from the $first to take the lower part, in the cutting $end take the upper part.
For example:
$file = "111222333444";
$xxx = Cut ($file, "1", "3");/the result is 11222. Should this be understood?
Attention:
"<td width=\" 307\ "height=\" 118\ ">"
In the "" content if there is also, you need to add in the front
Example
"<td width=" 307 "height=" 118 ">"
Become
"<td width=\" 307\ "height=\" 118\ ">"
The following code is the successful theft of foreign software:
?
Require './commom.php ';
Update ("index.htm");
$file =readfromfile ("cache/index.htm");
$GWRJ = Cut ($file, "<td width=\" 307\ "height=\" 118\ ">", "</TD>");
?>
And then in your HTML template, insert the code where you want it to appear.
? echo $GWRJ;?>

Other steals are the same.
Attention:
Here the HTML will need to be replaced with its own code, can be a total replacement, can also be a replacement.
We're talking about a separate replacement code:
$GWRJ = Cut ($file, "<td width=\" 307\ "height=\" 118\ ">", "</TD>");
$GWRJ = Str_replace ("soft/", "soft.php?id=", $GWRJ);
$GWRJ = Str_replace (". htm", "", $GWRJ);
Explain:
is to replace the code in the stolen foreign software.
The original
<a target=_blank href= "soft/18204.htm" >
Into the present.
<a target=_blank href= "soft.php?id=18204" >

Basically almost, many rookie talk should be very detailed. Do a first page template, and then one by one to dig out the things you want.
Think of a problem.
Index.htm, there are a lot of classified information, are called JS display content, how do you bring it over to display in your home page.
I hope everyone has been very successful in stealing.
Simple to talk about the classification of stealing. The same as the stolen home page. The code is as follows:
?
Require './commom.php ';

if ($soft) {
Update ("${soft}.htm", "soft");
$file =readfromfile ("cache/${soft}.htm");
}
?>
soft.php
Where $soft is passed from the front of the soft.php?id=1234.
If passed over 1234
Then it is updating read update ("1234.html", "soft");
Here today, teach the template tomorrow.
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.