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 Quote Link to comment 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. 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.