graeme_p - 5:58 pm on Feb 9, 2012 (gmt 0)
Glad to help. I am sure you are having a a lot this way. I once write my own (very simple, but reasonably fast and flexible) web server in TCL in somewhat a similar spirit.
The thing about not using a framework is that in order to keep things clean you are likely to end up writing one yourself. I use Django (Python not PHP, but Python is a *much* nicer language), the most popular is probably Ruby on Rails (written in Ruby). There are a number of PHP ones: Symfony looks most attractive to me. All of the above make working with databases easier as well.