Sample ActivityEntry.php3 Code - Personal Activities Calendar Program


<?php

//Call config.php3 and ActivityEntryForm.php3
require_once('config.php3');
require_once('ActivityEntryFormStep3.php3');

//If the $_POST submit is empty, set variables to null, call function to display form for the first time
if(empty($_POST['submit']))
{ $pass_act_title = "";
$pass_act_desc = "";
$pass_act_month_1 = "";
$pass_act_day_1 = "";
$pass_act_year_1 = "";
$pass_act_hour_1 = "";
$pass_act_month_2 = "";
$pass_act_day_2 = "";
$pass_act_year_2 = "";
$pass_act_hour_2 = "";
$pass_act_status = "";

//Set the $error_message to null
$error_message = "";

Activity_Entry_Form( $error_message, $pass_act_title, $pass_act_desc, $pass_act_month_1, $pass_act_day_1, $pass_act_year_1, $pass_act_hour_1,
$pass_act_month_2, $pass_act_day_2, $pass_act_year_2, $pass_act_hour_2, $pass_act_status );
}

//If the $_POST submit is not empty, include CheckData.php3, which will check for missing form data
else {

include ("CheckData.php3");

//If $error_message has been changed to yes, call function to print form again
if ($error_message == "yes")
{
Activity_Entry_Form( $error_message, $pass_act_title, $pass_act_desc, $pass_act_month_1, $pass_act_day_1, $pass_act_year_1, $pass_act_hour_1,
$pass_act_month_2, $pass_act_day_2, $pass_act_year_2, $pass_act_hour_2, $pass_act_status );
}
else { echo "insert data"; }

}
?>