Recipe Database
While my brother-in-law was living away from home, I created a recipe database to add to his WordPress blog to allow friends to share recipes with him. The module allows people to input recipes, stores them in a database, and then displays all recipes from the database on an output page. There is also an administrative interface to delete or flag recipes in the database.
After my brother-in-law moved away from home, I decided it would be fun to add a module to his WordPress blog that allowed his friends to share recipes with him.
Using PHP and MySQL, I created an application that allows people to input recipes, then store them in a database, and finally view all recipes from the database on an output page. There is also an administrative interface to delete or flag recipes in the database.
Recipe Input
On the recipe input screens, users enter the recipe information. When finished, they click the Preview button. The information is displayed on a confirmation screen. Users can either go back and edit the information, or they can Submit it. When submitted, the data is stored to the database, and an e-mail is sent to the administrator.
Recipe List (for blog Administrator)
I wanted to create a page that let the blog administrator see all the recipes with two views: (1) in-blog view (pretty) and (2) printable view. I also wanted him to be able to mark the items as printed. When the administrator clicks the Change link, the “printed” value toggles between “yes” and “no”, and the new value is stored in the database.
In-blog view
The in-blog view lets submitters see the recipe(s) they have entered, but keeps name and e-mail information private. It allows other site visitors to see the recipes without revealing any information about the person who submitted it. The blog administrator can access a different view that shows all the information the user submitted, including their name and e-mail address.
