brandonjp Posted September 12, 2007 Share Posted September 12, 2007 I've got an index.php file as follows: hard-coded header include(itempage.php) hard-coded footer BUT... the itempage.php has a couple defined variables that I'd like to use in the index.php file I can add include() or require() before the header, but it displays the content of the included file Is there a way to include, or require or reference a file so it will define the variables right away, but then display the actual contents of the file further down the page. --bp Link to comment https://forums.phpfreaks.com/topic/69073-any-way-to-include-but-not-display/ Share on other sites More sharing options...
Jessica Posted September 12, 2007 Share Posted September 12, 2007 define the variables on another config.php file. Then include that when you want the variables, and itempage.php when you want the output. Another option is to make all of the output part of a function, and only call the function when you want it to print. Link to comment https://forums.phpfreaks.com/topic/69073-any-way-to-include-but-not-display/#findComment-347190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.