Efficiently Logs referer, IP/Hostname, time, and browser type
By : Simon Steed
1st create ONE table (not four) as follows:-
CREATE TABLE statinfo ( browser text NOT NULL, date text NOT NULL, host text NOT NULL, referer text NOT NULL );
Then in the php3 file use the following code to populate it.
<? $connection = mysql_connect("localhost","login_name","password") or die ("Unable to connect to MySQL server."); $db = mysql_select_db(YOUR_DATABASE_NAME) or die ("Unable to select requested database");
$browser = $HTTP_USER_AGENT; $date = date("F jS Y, h:iA");
Works great. Any problems, contact me via http://www.xploiter.com/form.shtml
Regards
Simon Steed
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.