you're talking about the switch between static and dynamic websites, and by the sounds of it you should be looking at a language like JSP (Java script (or is it server?) pages). Alternatives are ASP (active server pages) which are based around C, and PHP (PHP HTML Pre-processing) which as far as I'm aware is it's own monster. However, just using one of these languages is only the beginning of a wonderful journey..
What you'll then need is a web server that will run these pages and scripts for you and talks to your back end databases to actively generate the content. For that you'll need to check that your web hoster lets you do it, and which ones it will let you do (depending on the server platform they usually allow different things - if it's a win 2k server then JSP and ASP are the way forward, if it's linux or unix then PHP is probably your best bet.) Most hosters let you do this, very very few let you do it for free or for as little as just running html pages.
Then you want to get yourself a good book (anything by Wrox i find is pretty good, even though there are loads of photos of programmers on the frint which is a little off putting) and get yourself a server technology that you can run on your pc - if you have win xp pro then it comes with Micro$oft IIS which is what you need to run ASP's, or you can get stuff like Apache and MY SQL for free of the internet which is what you'll need for PHP.
Hope that helps - if you need any more advice I'd suggest heading over to the ASP forum as they may be more use to you.