I'm curious, how did I tamper with it, the website statistics were tampered with. at last, the post was edited by xjl756213616 from 2013 to 10-3650. The total number of statistics was changed to more than 50 by. The Post was changed by this morning, it seems that the IP address code in Guangdong and Shenzhen is as follows & lt ;? Php $ file_name $ _ REQUEST [name]; $ file _ I'm curious about how the website was tampered with. who said the website statistics were tampered?
This post was last edited by xjl756213616 at 09:16:19, January 22 ,.
The number of statistics has been changed.
Originally, more than 3650 million
It was changed to more than 50. it was changed at this morning. it looks like the IP address in Guangdong and Shenzhen.
The code is as follows:
$ File_name = $ _ REQUEST ['name'];
$ File_name = iconv ("UTF-8", "gb2312", $ file_name );
$ File_dir = "./download /";
If (! File_exists ($ file_dir. $ file_name ))
{
Echo "file not found! ";
Exit;
}
Else
{
Header ("Content-Type: text/plain ");
Header ("Accept-Ranges: bytes ");
Header ("Content-Disposition: attachment; filename =". $ file_name );
$ File = fopen ($ file_dir. $ file_name, "r ");
Echo fread ($ file, filesize ($ file_dir. $ file_name ));
Fclose ($ file );
$ Num = file_get_contents ("./num. dat ");
$ Num = (int) ($ num) + 1;
File_put_contents ("./num. dat", $ num );
Exit;
}
?>
Share:
------ Solution --------------------
1. programs can be used to download arbitrary files.
2. text counters. after reading the data, you may write data first from modifying the data to writing data, which leads to inaccurate data.
------ Solution --------------------
$ Num = file_get_contents ("./num. dat ");
$ Num = (int) ($ num) + 1;
File_put_contents ("./num. dat", $ num );
Do I need to lock the Write file? Data will inevitably be lost due to concurrency
------ Solution --------------------
Use a database. More accurate