I was wondering if anyone could clarify which of the Include, virtual and passthrough function to use for certain situations.
I have 3 situations where I which to perform SSI type functions:
1/. to include plain html or txt files which require no further processing.
2/. to include php files with the php code embeded within the html.
3/. to include files which are first passed through a perl script (currently done by <!--#include virtual="/cgi-bin/apexec.pl?template=humour/index.htm" -->)
I guess the best method for situation 1 is use passthrough, but I would be grateful if someone knowledgable could set me straight.
I would also be interested to know if their are any caviats with any of these methods.
Cheers in advance.
For 1 & 2 you can either use include() or require()
don't forget to put <?php ?> around the PHP code in the includes by 2!
I'm not certain about 3, since I've never used that kind of includes.
Hope this helps
Cheers, I've used passthrough in a script I've created and from what I can see it seems to be the optimum way of just outputting html from another files - as it just outputs it straight - so I guess it uses v.little processing power.
However, what do I know!
passthru() would be good for 3:
For 1 and 2 you'll better use include/require() since those are the real "straight output" commands.
Sorry - got my functions mixed up
I meant fpassthru()
I'm even more confused now!
I think that since you already use <!--#include virtual=""--> for 3, you can use include()/require() for 1,2 and 3.