O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collecting data from a form and saving to a database

Using the same two tables of the previous recipe, we will create a form that will allow the user to select a language, add a function name, its summary, and related examples. We will then save this information to the functions table with the selected language.

Getting ready

Create Recipe2 folder inside the Chapter8 directory.

How to do it...

  1. Create a file named index.php inside the Recipe2 folder. Now, create a form with four fields. First, create a select box and query the language table to fill languages in it. Next, create two textboxes for Function name and Summary. Finally, create a textarea in which users will enter the example for that function. Assign a CSS class named required to each ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required