youngros Posted February 3, 2009 Report 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
Wickham Posted February 3, 2009 Report 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.
sjhwebdesign Posted February 3, 2009 Report 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"
jlhaslip Posted February 3, 2009 Report Posted February 3, 2009 include_once() will only include the file if it has not been included already.
youngros Posted February 4, 2009 Author Report Posted February 4, 2009 Thanks, got it all working now. Just the one file to edit and then 25 odd pages do it automatically.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now