steveangelis Posted August 28, 2009 Share Posted August 28, 2009 I am trying something that I thought would work but it fails miserably. I have my index page, and it calls up another page, via the usual include("page'); function which works perfectly. On the included page I have a series of variables that are echoed in various pages on the index page which work perfectly fine except for one. One variable is another include like this: $content = include("anotherpage.php"); The problem is that this second include is not being brought up where I am telling it to. Instead it is coming up exactly where I put the first include. Is there a way to get around this? Link to comment https://forums.phpfreaks.com/topic/172217-variables-include/ Share on other sites More sharing options...
trq Posted August 28, 2009 Share Posted August 28, 2009 What does anotherpage.php look like? Are you returning its contents? Link to comment https://forums.phpfreaks.com/topic/172217-variables-include/#findComment-908027 Share on other sites More sharing options...
steveangelis Posted August 28, 2009 Author Share Posted August 28, 2009 I have my standard index page which I am using as a template page for all others. It does the usual $_GET['p'] to get the page name from a link, and it loads the right page all fine and dandy. On the get page, I have another include but it is with a variable like this: $content = include("anotherpage.php"); Another page has a table along with a whole lot of strings and variables and what not on it along with a bunch of tables. Link to comment https://forums.phpfreaks.com/topic/172217-variables-include/#findComment-908030 Share on other sites More sharing options...
trq Posted August 28, 2009 Share Posted August 28, 2009 I'm not sure include works as you expect. Take a look at example #5 on the include man page. Link to comment https://forums.phpfreaks.com/topic/172217-variables-include/#findComment-908037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.