I despise the PHP language, and I\'m quite certain that I\'m not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating wi
Look at Catalyst this MVC (model, view, controller) framework works stand-a-lone or with apache_perl and hides a lot of the messy bits. There is a slightly odd learning curve (quick start, slower middle, then it really clicks for advanced stuff).
Catalyst allows you to use Template Toolkit to separate the design logic from the business logic, Template toolkit really is great, even if you decide not to use Catalyst then you should be using this. HTML::Mason isn't something I personally like, although if you do all the HTML yourself then you might want to review Template::Declare which is another alternative you can also use with Catalyst.
For database stuff look at DBIx::Class, which yet again works with Catalyst or on it's own.