casper2008 Posted November 12, 2008 Share Posted November 12, 2008 Hi all, I have file index.php as follows- <?php $GLOBALS['TEMPLATE']['footer_content'] = '<p>index footer text</p>'; // display the page include '../templates/template-page.php'; ?> and the template-page.php includes this section - <div id="footer"> <?php if (!empty($GLOBALS['TEMPLATE']['footer_content'])) { echo $GLOBALS['TEMPLATE']['footer_content']; } ?> </div> This works perfectly but if I change the template to - <div id="footer"> <p>some static footer text</p> <?php if (!empty($GLOBALS['TEMPLATE']['footer_content'])) { echo $GLOBALS['TEMPLATE']['footer_content']; } ?> </div> The $GLOBALS['TEMPLATE']['footer_content'] stops reading through and only the new text in the <p> tags comes through. Any help greatly appreciated. thanks Quote Link to comment https://forums.phpfreaks.com/topic/132356-help-with-variables/ Share on other sites More sharing options...
premiso Posted November 12, 2008 Share Posted November 12, 2008 Given that code everything seemed to work for me, ran a test on my own server and yea it showed up: some static footer text index footer text Quote Link to comment https://forums.phpfreaks.com/topic/132356-help-with-variables/#findComment-688154 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.