Use PHP to add the log function code for SHOPEX. In particular, it is impossible to know which spider has accessed this site, the frequency of access, the page, and general website statistics. Although I know little about PHP, I cannot solve it by using. NET development, especially by knowing which spiders have accessed this site, the frequency of access, pages, and general website statistics.
Although I know little about PHP, but with the development experience of. NET, Baidu is still very quick to complete, although simple, everyone does not laugh.
The code is as follows:
// Insert the SHOPEX homepage index. php code block
// Viewing the variables in PHP is actually quite simple.
// Use a function phpinfo () to view
$ Fp = fopen ("log.txt", "a + ");
Fwrite ($ fp, date ("Y-m-d H: I: s "));
Fwrite ($ fp, "\ t ");
Fwrite ($ fp, $ _ SERVER ['remote _ ADDR ']);
Fwrite ($ fp, "\ t ");
Fwrite ($ fp, $ _ SERVER ['http _ X_REWRITE_URL ']);
Fwrite ($ fp, "\ t ");
Fwrite ($ fp, $ _ SERVER ['http _ USER_AGENT ']);
Fwrite ($ fp, "\ t ");
Fwrite ($ fp, $ _ SERVER ["HTTP_REFERER"]);
Fwrite ($ fp, "\ n ");
Fclose ($ fp );
Bytes. Although I know little about PHP, but with the development of. NET...