You can't make an application backwards compatible if you don't have a previous one, but here are some tips:
- Stick to the general programming language rules/standards,
- Use easy and understandable names for classes, functions, etc,
- Document your code,
- Separate your database functions from your website functions, and separate the HTML from your code as much as possible (work object oriënted).