I usually create a line like ##FOOBAR## wherever I want the value of the users $foobar variable to be inserted, which I fetch from a database. I then just run a
for the web page. It's kind of crude but it works really well. I suppose you maybe want to do something more complicated? What exactly are you looking to do?