Writing The Footer FunctionThis will be the last code we will need for our output_fns.php file to dynamically display the design elements across your entire website.Once again, look at the code below and compare it with the code in your default.html file. Did you notice that we completely skipped over the code for column 2 in row 2 and went directly to row 3? Explanation: Column 2 in Row 2 is reserved for the unique content you will be putting on the new pages you create. Thus we only "call" the server to display the cells that will be needed globally for every page. Notice also that we replaced the date with <?php echo date("Y"); ?>. When the next year rolls around, your copyright notice will automatically update to the current year. Think about having to manually change those dates on a few hundred pages! COPY AND PASTE ALL OF THE CODE TO YOUR output_fns.php FILE, LEAVING A FEW EMPTY LINES BELOW THE LAST CODE YOU INSERTED. Then Close output_fns.php. function display_html_footer(){ ?> <!-- FOOTER --> <TR> <TD BGCOLOR="#006600" COLSPAN="2" ALIGN="center" VALIGN="top"><FONT COLOR="#FFFFCC">© <?php echo date("Y"); ?> MYSITE.COM</FONT><BR> </TD> </TR> <!-- END OUR TABLE --> </TABLE> </BODY> </HTML> <?php }
|