robertnorgren Posted February 3, 2011 Share Posted February 3, 2011 Hi! I'd like to echo a text section from pageB.php to pageA.php Is it possible to mark it up somehow and tell the browser to echo the variable? I'm thinking something like this should work after some alteration: pageA: <?php echo pageb.php/variable; ?> pageB: <?php $variable = ***the content section I want to be displayed on pageA*** "; ?> I'd be very grateful if someone could help me out. (: Quote Link to comment Share on other sites More sharing options...
requinix Posted February 3, 2011 Share Posted February 3, 2011 include "pageB.php"; echo $variable; $variable = "Content"; Quote Link to comment Share on other sites More sharing options...
robertnorgren Posted February 3, 2011 Author Share Posted February 3, 2011 Thanks! However, the code provided prints the entire pageB onto pageA. I'm pretty sure I'm doing it right. Have you tested the code? Regards. Quote Link to comment Share on other sites More sharing options...
litebearer Posted February 3, 2011 Share Posted February 3, 2011 perhaps using sessions may help Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 3, 2011 Share Posted February 3, 2011 based on your example, there is only the variable definition in pageB. if there is more than that, it will also be include()'ed. 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.