Today we teach to steal the home page. Different home pages require different methods of stealing, mainly to analyze HTML code. The functions and methods were introduced clearly in the first two days. Today we explain and use them in practice.
Or take the Huajun Software Park to take action.
Open the homepage of Huajun Software Park
/
Create a new page with Dreamweaver.
Notice:
First make the homepage template you want, and then start stealing the homepage. Since considering the tutorial for beginners, first put the template and PHP processing code in the same webpage.
In the future, I will teach you the separation of HTML and PHP.
After the template is established, we will start stealing.
In <html>
Insert PHP code above, as follows:
<?
require './';
update("");
$file=readfromfile("cache/");
?>
explain
require './'//Introduce files
update("")//Read and write to the web page
$file=readfromfile("cache/")//Read from local folder cache
The $file here is a variable, you can name it at will. You can also call it $html
But when used later, it must be unified.
The above code does not process anything, nor does it output anything. If you say you output $file, then it is all the html code.
Let’s start to get what we want.
1 Get the code updated from foreign software.
You can choose a variable named $gwrj //Foreign software, please take the name as you like
How do you take out the foreign software we want from this? Here is a cut function we mentioned in the previous section
$gwrj = cut($file,"<TD width=\"307\" height=\"118\">","</TD>");
explain
$xxx = cut($file,"$first","$end");
How does it work? It is to cut $file() from $first to take the lower part, and then cut $end to take the upper part.
For example:
$file = "111222333444";
$xxx = cut($file,"1","3");//The result is 11222. You should understand this explanation?
Notice:
"<TD width=\"307\" height=\"118\">"
If there is also " in ", you need to add \ in front of it
example
"<TD width="307" height="118">"
become
"<TD width=\"307\" height=\"118\">"
The following code successfully steals foreign software:
<?
require './';
update("");
$file=readfromfile("cache/");
$gwrj = cut($file,"<TD width=\"307\" height=\"118\">","</TD>");
?>
Then in your html template, insert the code where it needs to be displayed
<? echo $gwrj; ?>
The same goes for other steals.
Notice:
The HTML taken out here needs to be replaced with your own code, which can be replaced in total or one by one.
Let's talk about changing the code separately:
$gwrj = cut($file,"<TD width=\"307\" height=\"118\">","</TD>");
$gwrj = str_replace("soft/","?.htm","",$gwrj);
explain:
It is to replace the code in the stolen foreign software.
The original
<a target=_blank href="soft/">
Become the present
<a target=_blank href="?id=18204">
It’s basically the same, and many rookies should be very detailed. First make the homepage template, and then dig out what you want one by one.
Think of a question.
There are many classified information in this article, which are all displayed by calling JS. How do you take it over and display it on your homepage?
I hope everyone's stealing goes smoothly.
Let’s briefly talk about the stealing of categories. The same as stealing the home page. The code is as follows:
<?
require './';
if($soft){
update("${soft}.htm","soft");
$file=readfromfile("cache/${soft}.htm");
}
?>
Among them, $soft is passed from the front?id=1234
If passed 1234
Then it is to update the update("","soft");
That’s all today, I’ll teach you the template tomorrow.