I am working on a system, where I have sets of templates, and a special php file that reads from a database, and parses the templates, to display data in different formats.
The templates are generally used just as an addition to a regular html page (to do things like display latest news etc.), and so are included via SSI:
This instucts the parsing code to parse the template, latest_news.html, 5 times using table 20 from the database.
This all works fine.
However, in some cases, I want to return, say, a list of categories to use in my next include. I understand I can return data from includes, if they are done locally (ala include("/htdocs/parser.php")).
So my problem boils down to 2 things, one of which I need to solve:
- I cannot pass things to a local include (can I?) - such as the source, template, number of items etc... Could I fake a QUERY_STRING environment variable? Other options?
- I cannot retrieve data from a remote include in a regular manner. Could I redirect the output from an remote include into a local variable, (returning it in a semicolon delimited nature) then parse that? (There will only ever be about 5-6 short text strings I need returned).
I know this is a lot of input all at once, and I am maybe missing something obvious, so thanks for bearing with me.
I should mention, that my data source is used for a forums system, and so I am working within certain constraints on how I can go about this.