PHP Programming tips

From CSWiki
Revision as of 09:17, 17 June 2005 by Savvasn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The purpose of this page is to provide guidelines on php programming and in WEB- programming in general.

Using a good tool and knowing the capabilities of that tool will save you a lot of time and pain :). Most of the modern web-design tools can also provide you with common script language programming tools that can save you tons of time and frustration.
SO SPEND SOME TIME TO LEARN HOW TO USE the tool of your choice.

Things you should have in mind.

  1. It is a very good idea to use templates
  2. When having menus or things that will change often in a template, put them in different files and include those files in the template. This way it is easier to update a menu and to have more control
  3. Use configuration files. Preferably keep those configs in a directory by themselves.
    • If one needs to make any changes to the site you are creating he/she should not have to change anything else in any other place except those files.
  4. Reuse the code as much as possible. Instead of writing 5 times a JavaScript function that does similar things write it once in a file, and make it as generic as possible. Then include that file in all the pages you need it.