When you say the code 'doesn't work' - what is diaplayed?
With regard to server side control of a retail website, this method offers full control over which articles are displayed. I pulled this explanantion from my website to explain further.
If your website consists of just a few pages, the content is easy to manage and editing is quite straight forward. If, however, your website consists of a large number of pages then editing them individually turns into an impossible task. The answer is to automate the pages so that they are created, on demand, by the website itself from files or a database. All this operation is totally transparent to both you and your visitors but it makes the whole process of managing your website a whole lot easier.
Database driven websites are ideal for web shops or any website which displays multiple items. Most web shops have pages displaying a selection of products and then an option to find out more details about that particular product.
The time consuming pastime of creating a separate page for each product, on a site with a large stock range is unnecessary. When the details of each product are stored in a database, a range of items, or an individual item can be selected to appear in a pre-prepared page so rather than edit multiple pages you only have to edit the product details, making it easier to keep your product range up to date and your pages uniform.
If yours is a retail business, you probably have your stock range in a database already and such information can be regularly uploaded to your website, saving you even more time. It is also possible to automtically upload your stock range to the website at regular intervals leaving you to get on with running your business and your website up to date.
Keith