|In this tutorial, we will continue to work on the ActivityEntry.php3 program file for the Personal Activities Calendar Program project. So far we have written the code for the part of the program that tests if the Activity Entry web form has been filled out and submitted to the program.|
If the $_POST['submit'] is empty, the submit button on the web form has not been used and the form has not been filled out. In this case, the program will send the web form to the browser via an echo statement. Here is the code so far. This works fine if this was the only time that the program needed to send the web form to the browser. But we need to consider that this same web form will be sent to the browser in three instances.
But we will need to use this same echo statement for all three instances. So we can make our program more efficient if we change the echo statement to a function. Then any time the program needs the web form, we will call the function. Therefore, we will need to change the echo statement in the code above to a function call.