logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel
Southwest USA


dailyclick
All times in EST

Full Schedule
g
g PHP Site

BellaOnline's PHP Editor

g

Personal Activities Calendar Program - Collect Data Into Your PHP Program With An HTML Web Form

Guest Author - Diane Cipollo

In the last tutorial, we began a Personal Activities Calendar Program written in PHP and we created a database table to store information about scheduled activities and events. Now that we have our table created in our database, the next step is to create an HTML web form that we can use to collect the specifics about new activities and then send that information to the php program.

Our first step in designing the web form is to analyze each piece of information that we will be collecting and decide which type of HTML form tag to use to collect that piece of data. If you are unfamiliar with HTML form tags, check out my HTML site here at BellaOnline.

act_ID
In the last tutorial, we called the first field in our activities table the act_ID field which is a unique identifier for each record. Because this table field is set to auto increment, we don't need to collect any data for the field with our web form.

act_title
The title of the activity or event is just a short line of text so we can use an HTML text input tag to collect this.

act_desc
The description of the activity could be very short or quite detailed. So we will use the textarea tag for this field.

act_month_1
act_day_1
act_year_1
act_hour_1
These input fields will collect the beginning date (month, day, year, hour) of the activity. To prevent confusion caused by incorrectly typed data, it is better to use the HTML select tag in the web form for the date information. One tag will display a drop-down list of the months of the year and a second tag will display the days of the month. You guessed it, the third tag will display a span of years. Of course, this span can include as many years as you need. However, you can omit this third tag if your activities program is for just a yearly calendar. The names of the months are displayed in text format (such as January, February). This will make the web form more user friendly. Finally, one more select tag will display the hour of the day that the activity is scheduled for (in one half hour increments).

act_month_2
act_day_2
act_year_2
act_hour_2
We will create a second group of these tags for the ending date (month, day, year, hour) of the activity. We will use a number one on the end of the beginning date input fields and a number two on the end of the second group.

act_timestamp_1
act_timestamp_2
After the date and time is collected by the tags we just discussed, the program will convert the beginning and ending date/time to a Unix timestamp and store the timestamp in the table. Since this is done by the program, we will not need to have a tag for these fields in our web form.

act_status
When you first enter an activity into the calendar, the act_status of the activity is set to incomplete by default. However, you will want to update the status of the activity to complete at a later date. We will use a radio button input tag that will allow you to switch the status from incomplete to complete.







This site needs an editor - click to learn more!

Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Twitter Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Facebook Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to MySpace Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Del.icio.us Digg Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Yahoo My Web Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Google Bookmarks Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Stumbleupon Add Personal+Activities+Calendar+Program+%2D+Collect+Data+Into+Your+PHP+Program+With+An+HTML+Web+Form to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the PHP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor