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? 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; 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; 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
Archived
This topic is now archived and is closed to further replies.