Jump to content
Larry Ullman's Book Forums

Chapter 3 - Functions In Script


Recommended Posts

Hi Everyone,

 

Just had a quick question regarding chapter 3; script 3.7.  More specifically when we're learning about creating functions for ads for the linked webpages.  My question relates to when we use the function in relation to when we use the include function.  When I add my create_ad() function after I do include(includes/header.html) it prints out "This is an annoying ad!" formatted according to the template.  However, if I add the function before the include it just displays it on the top left of the page.  So is the reason why it gets formatted because when we use the include function, it is placing the css code within the index.php and then reading the function whereas if I place it before, then technically it would be outside the scope of the included page?  Just needed a little clarification, thanks!

 

Best,

G

Link to comment
Share on other sites

 Share

×
×
  • Create New...