title: Save users activity
body: <p>I am a web developer and I want to design a commercial website to sell a customer's product. Sell and buy activities are important and I need to maintain user activity information to keep the site secure.</p>
  
  <p>I want to write a dynamic website. I want to control all user activity and then decide whether to save user activity information in a database. Some of site's visitors are registered users and some are anonymous. I want to save online information such as ip address, username, page name, and date/time for my registered users.</p>
  
  <p>I want to know:</p>
  
  <ul>
  <li>How do I save a user's IP address?</li>
  <li>What more do I need to save?</li>
  </ul>