youngros Posted February 3, 2009 Report Share Posted February 3, 2009 (edited) Can you use too many, and are there any implications in including an include within an include. I know they work as I have tested it. The reason for asking is I have a couple of "news" boxes on my site, which will give a snippet of news and then have a link to the full story. Sometimes I may only have one box, or may have three and I don't want to have to update every page so wanted to have the whole left column which includes navigation into one php file. Thoughts, comments, advice please. Edited February 3, 2009 by youngros Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 3, 2009 Report Share Posted February 3, 2009 I agree that you can put includes inside includes; it just makes the page a bit more complicated and you have to keep a check on what's happening when they all display. Quote Link to comment Share on other sites More sharing options...
sjhwebdesign Posted February 3, 2009 Report Share Posted February 3, 2009 as long as you don't include a page more than once. eg index.php includes config.php index.php includes header.php header.php includes config.php you will get error about "headers already sent" Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted February 3, 2009 Report Share Posted February 3, 2009 include_once() will only include the file if it has not been included already. Quote Link to comment Share on other sites More sharing options...
youngros Posted February 4, 2009 Author Report Share Posted February 4, 2009 Thanks, got it all working now. Just the one file to edit and then 25 odd pages do it automatically. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.