try this..it's easy

February 6, 2008 by ashish patel

make a use of session or application variable both are easy..

when user visits your page increment session value and store in the database.

 

if you need more help..reply me back..i'll send you code..