tricky77puzzle 0 Report post Posted January 30, 2008 (If I am posting this in the wrong forum, please tell me the correct place to be putting it.)I want to install a global announcement banner on the top my website, in case there is some major update. I am currently learning PHP for this very purpose, and would like to ask how it is made. (I know how the HTML layout is going to look like, I just want to be able to actually include the PHP portion on the website.)I heard it had something to do with includes in PHP... how exactly does this work? Share this post Link to post Share on other sites
sonesay 7 Report post Posted January 30, 2008 all it is is just a section of code being included. THat section of code can be what ever you'd like included and you can place it where ever you likefor exampleindex.php---------------*page start*include('stuff.php');*page end---------------thats how it works. You can apply includes to all individual files you want included or you can make 1 template and include it there, that way the template can be used for all your web pages. Share this post Link to post Share on other sites
tricky77puzzle 0 Report post Posted January 30, 2008 all it is is just a section of code being included. THat section of code can be what ever you'd like included and you can place it where ever you likefor exampleindex.php---------------*page start*include('stuff.php');*page end---------------thats how it works. You can apply includes to all individual files you want included or you can make 1 template and include it there, that way the template can be used for all your web pages. For some reason, I remember the manual saying that the PHP stuff like that was only for header files.I'll try that, though, and see if it works. Share this post Link to post Share on other sites
hitmanblood 0 Report post Posted January 30, 2008 Yes you are right but the thing is that you have to include all files and start sessions and other cookies before you send any header information. However if you like to make different sections and models of code like me then you would include code in method or function and then simply call the function in the part of code where you need it in fact. Share this post Link to post Share on other sites
tricky77puzzle 0 Report post Posted January 31, 2008 Yes you are right but the thing is that you have to include all files and start sessions and other cookies before you send any header information. However if you like to make different sections and models of code like me then you would include code in method or function and then simply call the function in the part of code where you need it in fact.I don't actually need it for functions. I just want to include a sidebar. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted January 31, 2008 Design your html page with the sidebars as you want them. Instead of adding the content to the div for the sidebar, do the php include as per above for that div. Make sure the page has a php file extension and not an html extension. (Or mod your htaccess file to have html pages parsed as php.) Share this post Link to post Share on other sites