Anti-Leech PHP code and anti-Leech PHP code. Anti-Leech PHP code and anti-Leech PHP code? Php * usage: save the upstream code as dao4.php. for example, if validatecode.rar is used in the test site www.niuzen.com, use the following code to refer to the PHP code for anti-Leech protection and the PHP code for anti-Leech protection.
Http://php.662p.com/thread-456-1-1.html
Php anti-Leech code
This implementation using php consumes more resources. we recommend that you start with the server and change apache configuration.
The following is the code implemented by php. xxx.mp3 is the actual address of your music file. only the php address is transmitted during external communication. The mp3 address is not publicly available.
If (strpos ($ _ SERVER ['http _ referer'], 'qq. com ')! = FALSE ){
Header ('http/1.1 404 Not Found ');
Exit;
}
Readfile('xxx.mp3 ');
?>
How to enable anti-Leech protection in PHP
I am a beginner in php. I can only help you explain the meaning of this expression. As for the proportion of server bandwidth, I have never touched on it and do not understand it.
The readfile () function reads a file and writes it to the output buffer. if "fopen wrappers" has been activated, you can use the URL as the file name in this function.
The parameter $ _ GET ['URL'] in your example should be an array, 'url' is an index, and the value should be a url address () the function writes the url address as the file name to the output cache.
Why? Php/* usage: save the above code as dao4.php, such as the test with validatecode.rar in the site http://www.niuzen.com, then use the following code...