Just learning about functions and need help understanding this to put it all together. Below is what I have so far.
I created a form and now working on PHP portion. This will return an html web page. I will make it pretty later, just trying to understand this portion. Please look at the comments to understand what each function does. Thank You for any help!
[php]<?php
pagemain();
pageheader();
pagebody();
pagefooter();
//gathers all information and calls all other functions. Not sure how to do this.
function pagemain(){
}
/pageheader will create top html code, including header section.
It will have user write title of page and choose background color/
function pageheader(){
global $page_Title;
global $HTML;
global $HTML2;
global $bg_Color;
$HTML +="$page_Title";
$HTML2 +=“background-color: $bg_Color>”;
}
//pagebody will have welcome title and welcome statement. Does NOT close body section
function pagebody() {
global $w_Title;
global $statement;
global $HTML;
$HTML +="$w_Title
$statement
";
}
//footer information will have footer and close body section and all other html tags
function pagefooter(){
global $footer;
global $HTML;
$HTML +="";
}
//pulled in from the form
$page_Title = filter_input(INPUT_POST, “page_Title”);
$bg_Color = filter_input(INPUT_POST, “bg_Color”);
$w_Title = filter_input(INPUT_POST, “w_Title”);
$statement = filter_input(INPUT_POST, “statement”);
$footer = filter_input(INPUT_POST, “footer”);
?>
[/php]