You can create a database table with the lines:
- date and time
- IP address
- Current url
- Referrer URL
- Serialized $ _GET
- Serialized $ _POST
- Serialized $ _COOKIE
This is very useful if you want to track traffic.
pseudo code:
if(!$bot) { $visit = Array( 'date' => date("Ymd H:i:s"), 'ip' => $_SERVER['REMOTE_ADDR'], etc ... ); $sql = "INSERT INTO visits (`".join("`,`",array_keys($visit)."`) VALUES ('".join("','",array_values($visit)."')"; ... }
Use the same database, so you will have fewer connections to the mysql server.
Do it in a PHP script (after mysql_connect good idea), I believe that one INSERT per visit is not a big problem for your machine.
Peter source share