General Query: Is there a way to read a variable from another PHP file, without running the file (as the variable had been set at another point in time, using a third PHP file), and without the use of a database?
Specific Instance: I created a webpage that my boss wants to change daily. He doesn't want to access the raw HTML and CSS coding, as any mistake will lead to headaches on my end. So I thought I might create a small portal that will allow him to change the specific string data within the webpage each day, limiting his access to the code.
The framework I conceived would work like this:
- index.php is the page that is viewable by everyone on the internet. When it is rendered, I'd like it to request the $Category variable that was saved previously in another file.
- edit.php is a webpage that displays a simple form with two input boxes: Category and Password. When the submit button is clicked, it POSTs the data to the file below.
- configuration.php is the file that edit.php hands the form information off to. Once the form information has been handed off, it checks to see if the crypt() version of the input password matches, and then stores the Category information in a variable called $Category.
Now, I need a way for index.php to read the previously saved value of $Category within the configuration.php file, without running it, and without using a database (as I do not have access to one). I don't think I can use session values, because this value should be the same for all users and all sessions, until it is changed again by my boss. Is there any way to implement this, or should I be using a different method?