1. Analysis of incorrect practices
// Add the error page below and submit it to Baidu
The code is as follows: |
|
$ Hand = fopen ("$ path/bad_url.txt", ""); Fwrite ($ hand, "\ r". 'Http: // www.111cn.net '. $ rs ['Your address']); Fclose ($ hand ); |
The result shows that the output is
Http://www.111cn.net/database/mysql/57520.htm http://www.111cn.net/wy/js-ajax/57519.htm
This kind of continuity is not what I want
Http://www.111cn.net/database/mysql/57520.htm
Http://www.111cn.net/wy/js-ajax/57519.htm
I did not think about using chr (13) or chr (32) like ascii code. I have handled the carriage return and line feed of the htm form, after the test, it still does not work. At that time, it is only a hundred degrees.
The code is as follows: |
|
<? Php $ Stream = fopen ("robots.txt", "w + "); Fwrite ($ stream, "Are you breaking the line? \ R \ n I already have a line break! "); ?> |
Note: Do not use single quotes in the code. I am wrong in this step. If single quotes are used, the output will be User-agent: * \ r \ nDisallow: /Because the single quotes in PHP do not replace the content, double quotation marks are used, because the double quotation marks in PHP are used to check the content.
After several times, you can delete the file, which is the expected result.
To sum up, this \ r \ n small editor has tried \ n \ r and seems to be useless. It's just basic knowledge or you don't have to forget it for a long time.
Site original: reprinted indicated Source http://www.111cn.net