Making Usage Statistics in PHP Making usage statistics on a web site is one of the most enjoyable things for me on the Internet. Thanks to the technology, you can see each click of each visitor, the date of the visiting, and how many seconds the user was reading your site. I use this feature to track which of my articles was read for the longest time. In this article I will show you how to store the statistics in a MySQL database, show the web stats in an HTML table and make figures based on the stats using the GD library. -------------------------------------------------------------------------------- Making Usage Statistics in PHP - Storing the Data
Let's start with the database part. We'll need only one table that stores each click (page impression) of each visitor. The name of the table will be "hits". What should we store here? 1. The hostname is very important to identify the client. PHP gives us the IP address that I like to convert to hostname with gethostbyaddr(). I think it's better to see a string. 2. The time of visit can be stored easily by using the NOW() function of MySQL. 3. The visited page on your site should be stored. In most cases, you should store the URL of the visited page and the HTML title in two separated fields, eg. URL and Title fields, so that you'll be able to see your most visited sites simply by looking through the list of their titles. Click here to read more about this Article or simple type http://www.helpcode r.com/index. php?topic= 65.0 in your address bar. In order to register at HelpCode.com click here. We are regularly adding very useful Articles on helpcoder.com. Post your problems and get the replies on timely basis. In case of any query send us email at [EMAIL PROTECTED] .com To unsubscribe simply send us email at unsubscribe@ helpcoder. com with the subject of REMOVE BEST REGARDS; HELPCODER TEAM Learn and Teach Others :) ------------ --------- ------ --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. [Non-text portions of this message have been removed]
