|
I attempt to create functions for code that I want to use throughout my application. For example I create a html_begin and a html_end function to take care of my HTML => header and footer
HEADER
<?
function html_Begin($title = "Default") {
global $col_bg,$col_link;
/* These variable are outside my function so I define the a global
variables */
print
"<HTML><HEAD><TITLE>$_title</TITLE>";
print "</HEAD>";
print "<BODY bgcolor=\"$col_bg\" link=\"$col_link\
alink=\"$col_link\">";
print "<TITLE>$_title</TITLE>";
}
// I would call the this function like this;
html_Begin("Welcome TO PHP");
?>
FOOTER
<?
function html_End() {
print "</BODY></HTML>";
}
// I would call the this function like this;
html_End();
?>
>> Comments/FeedBack
|