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

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

new
Spirituality
Home Improvement
Vegetarian
NASCAR
Southcentral USA


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g PHP Site
Editor Wanted
BellaOnline's PHP Editor

g

Personal Activities Calendar Program - Printing The Web Form With A Function - 2
Guest Author - Diane Cipollo

To make the program easier to maintain, let's put the code for this function in a separate file. Let's call that file ActivityEntryForm.php3 and let's call this function Activity_Entry_Form( ). Here is the beginning of the function code.

function Activity_Entry_Form( )
{ … echo statement … }

Now we need to add the echo statement.

function Activity_Entry_Form( )
{
echo "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
...
<form>
...
</form>

</body>
</html>";
}

That's all for now, save your file as ActivityEntryForm.php3.

Now we need to go back to our original ActivityEntry.php3 file and make some changes. Remember that we need to remove the echo statement and replace it with the function call for the Activity_Entry_Form( ) function. We also need to add a require_once statement to include the ActivityEntryForm.php3 file. Here is the finished changes to the ActivityEntry.php3 file.

require_once('ActivityEntryForm.php3');

if(empty($_POST['submit']))
{
Activity_Entry_Form( );
}

← Back







This site needs an editor - click to learn more!

RSS | Related Articles | Previous Features | Site Map


Content copyright © 2008 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.

Digg! g delicious Save to Del.icio.us

g


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

g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Driving Amount
Much more
Slightly more
Slightly less
Much less

g


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


BellaOnline Editor