Study source code from open source projects like mediawiki (which is what wikipedia runs on) or wordpress (the blogging engine) or Drupal (the CMS) etc. etc.<p>Remember, one of the 4 Freedoms of Free software is the Freedom to study it and learn from it.