ShoeLace1291 Posted September 12, 2007 Share Posted September 12, 2007 Ok, in the file 'index_body.tpl', I want the variable 'GAMESLIST' to include the file 'includes/getgames.php'. Is there another way to get the file without displaying it twice? This is my code: //VV also displays getgames.php $displaygames = include("includes/getgames.php"); $temps = array( 'GAMESLIST' => $displaygames ); $displaygames = file_get_contents("themes/default/index_body.tpl"); foreach($temps as $template_var => $replacement_var){ $displaygames= str_replace($template_var, $replacement_var, $displaygames); } echo $displaygames; Quote Link to comment Share on other sites More sharing options...
brent123456 Posted September 13, 2007 Share Posted September 13, 2007 You could try $displaygames = require_once("includes/getgames.php"); 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.