Using filters and templates in PHP

An order form can be added to the website created before in order to transform it into an e-commerce website. When someone orders a phone, the order should be saved to a text file. A reporting facility can also be added.

Filters were recently added to PHP in order to provide sanitization as well as validation facilities. The work to do is to make sure that any data being submitted from the order form is properly sanitized and validated. This helps in making the web application more secure.

Usual PHP scripts mix both programming elements (the PHP) with HTML markup. This tends to make the web application less maintainable and can prevent web designers and programmers from working at the same time.

One common solution to that problem is to use a templating engine like Smarty. This engine allows the programmer to separate PHP from HTML markup while increasing flexibility. The work to do is to rewrite the web application to use Smarty.