Re: Use CF and PHP tags in one script?
| From: | James Du Russel | Date: | Tue, 20 Jun 2000 16:51:43 +0000 |
| Subject: | Re: Use CF and PHP tags in one script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2328@lists.php.net to get a copy of this message | ||
>
> I have a problem - ColdFusion can only <CFINCLUDE> other CF files.
>
> What I would like to be able to do is to have a html/cfm/php file
> which is run through both the CF and PHP parsers. Having a .php file
> do an internal request for a .cfm file and including the results is
> _not_ suitable - that would be too easy. <grin>
>
Well, I see two ways to do this...
Stop CF or PHP (whichever you want to process the file first) from
sending it's output to the client. There is some support for this in
Apache, latest versions have the best support. Read the docs. It's
called output chains or something like that. *forgets*
The simpler, though uglier way would be to write a file in CF, and
somehow make it not destroy any php tags (I suggest trying <?php ?>
style tags) And have PHP load (via http) the file and eval it.
Of course, the best way to do this would be to get rid of CF entirely.
=) You could theoretically cook up a CF parser in PHP...or write one in
Perl that rewrote the CF tags into php function calls.
Generally, mixing technologies is not going to be a good idea. You're
adding more complexity, and that means more overhead, less speed, and
more chance for error. Not to mention very hard to maintain code.
James