I am working on a framework for my site that will create all pages from a series of includes. For unimportant reasons, I want to be able to also pass variable names through the URL to replace specified includes with a different file.
Each file will begin with a series of definitions like so:
if (!isset($c1)) {$c1="blah1.txt";} //First item in the center column
An example of the URL would be:
http://www.example.com?c1=blah2.txt
Later in the body of the document I might have:
<?php @include "$c1"; ?>
The 'if statement' should let the URL to define the variable and only use the value in the script if it is not passed in the URL. Later in the script when the variable is included, it should use the one supplied by the URL and the one in the script should be forgotten.
Sometimes this actually works as expected and "blah2.txt" replaces "blah1.txt". Usually, however, BOTH "blah2.txt and "blah1.txt" show up on the page until I refresh.
What is happening?