pretty simple really. store all the components in a database with a component_id, description and price. fetch all the components from the db then use HTML forms to allow the users to add/remove components. store each added component in a session and total up all of the individual component prices.
it is the same basic idea as a shopping cart. check out hotscripts.com for shopping cart scripts.