I've gotten stumped on my current project, hoping to hear some ideas from the masters 🙂
I have a directory script that I'm almost finished with, trying to add a new feature. There are seven pages that are exactly the same, but the content of the page is based from a category. (seven different categories in seven different directories). The way I'm "setting" the category is
$cat = "category one";
at the beginning of each page. The problem is, that when I need to update the page, I have to edit all seven pages and set $cat again. Seems like too much work to me. So I tried this:
I tried creating a simple .html file that only included the name of $cat, and putting the file in each folder (for each of the seven categories). Example:
//directory1
//cat.html
category one
Then instead of $cat = "category one"
I tried: $cat = include("cat.html");
This way, I could set $cat in each directory with its own "cat.html" file, and read the category from that file. I could also update the file, and not have to worry about "resetting" each category.
of course, this doesnt work. It returns a "1" instead of the file contents. Any ideas are greatly appreciated!