views:

68

answers:

4

I have a small website for a company that have 40-50 product. The site will be in french and English. Each product will have 2-3 different price (based on shipping)

So the standard approach, will be to do 50 (100 in both language) different web page done with an template engine, maybe pure HTML and css coding

The other solution, make 1 page with PHP, get all the product in database and populate that single page, that will be harder to program, but the page will create itself

So the question : what YOU will do, what is the approach you will take

Take in account that the php-database option is a lot harder to make it work first !, all the time worth to get only that small count of product. I have no doubt if there is 2500 products.

Thanks in advance


Based on the 4 great answer, i will go with a database, let make it the right way, event if it a little bit more complicated

two more question, what will be the code for the modrewrite what software (web or mac) to populate/edit the sqllite database

+4  A: 

I would definitely make the PHP page. If you have to make changes to the product pages, then all you have to do it do it in one place (in the PHP). It can make maintenance far easier in the future.

Jon
+2  A: 

I would definitely go the single PHP programming route, but I would do a URL Rewrite so that each page appears to be its own page. This will help for SEO, etc.

So the pages might look like this:

http://www.example.com/products/redcar/

http://www.example.com/products/bluecar/

http://www.example.com/products/greencar/

But they actually point to http://www.example.com/product.php?product=redcar etc

Micky McQuade
+1  A: 

Definitely go with the database and script approach. Adding a row to a db is a lot simpler than creating and managing yet another html file. Even with just 50 products, imagine if you wanted to increase the price of your products by 1.5%: with a db, it's a single query process; with static html you're stuck editing each and every page.

Something else to consider is that with a db, you are not limited in the ways you present your data. So as well as single product pages, you can also generate product category summary pages, search result pages, etc.

dnagirl
A: 

If you will be involved with this project in the future, OR if the product line will expand and you want to serve the company most effectively, then you should use the database approach.

If you won't be involved in the future, AND you have no experience with PHP and a database, AND you are used to a template engine that makes all this a snap, then I agree that you have a difficult decision.

I certainly would use the database approach; among other things, it would allow the language variation to be handled very elegantly. But that is a reflection of my experience.

Smandoli