
A variable is used to store information. If it is declared outside a procedure then it can be changed by any script in the file. However, if it is declared inside a procedure, then it is created and destroyed each time the procedure is executed in the file. Arrays are used to store a series of data items that are related.

Session variable store information about a single user and are available to all pages. Application variables are available to all pages in a single application. They are used to store information about ALL users in a specific application.

User input should be validated on the browser whenever possible. Browser validation reduces the server's load, and server validation should be consider if the user input is going to be inserted into a database. This can be done by posting the form to itself rather than jumping to a different page. Then the user will get the error messages on the same page and they are easier to discover.