Darkmatter5 Posted June 2, 2009 Share Posted June 2, 2009 Here's the config.php file. <?php $game_title="DEFAULT TITLE"; $admin_email="[email protected]"; $url="http://www.nothing.com/"; ?> Now here's my page file. <?php include_once('library/config.php'); ?> In the page file how can I display $game_title, $admin_email and $url? Quote Link to comment https://forums.phpfreaks.com/topic/160669-using-variables-created-in-an-included-file/ Share on other sites More sharing options...
anupamsaha Posted June 2, 2009 Share Posted June 2, 2009 Here's the config.php file. <?php $game_title="DEFAULT TITLE"; $admin_email="[email protected]"; $url="http://www.nothing.com/"; ?> Now here's my page file. <?php include_once('library/config.php'); ?> In the page file how can I display $game_title, $admin_email and $url? echo $game_title; echo $admin_email; echo $url; Quote Link to comment https://forums.phpfreaks.com/topic/160669-using-variables-created-in-an-included-file/#findComment-847909 Share on other sites More sharing options...
Alex Posted June 2, 2009 Share Posted June 2, 2009 The same way you normally would. eg. echo $game_title; Quote Link to comment https://forums.phpfreaks.com/topic/160669-using-variables-created-in-an-included-file/#findComment-847911 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.