5.2. Creating the Entry Input Form

Storing entries in your database requires that you allow site administrators to enter data via a web form. Before you can do this, you need to identify which fields the form must include.

Two of your fields are populated automatically when an entry is created: the id field will generate an automatically incremented number to identify the entry, and the created field automatically stores the timestamp for the entry's creation date. All you need to include are fields to enter the title and entry fields.

Your title field has a maximum length of 150 characters, so you use an input tag with a maxlength attribute for this. The entry field can be as long as you want it to, so create a textarea tag.

In Eclipse, create ...

Get PHP for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.