![]() |
| Including .cfm templates in .shtml files |
|
byron
Forum Admin
|
If you are using .shtml files you can do a server side include of CF templates.
Use the #exec directive instead of the #include directive in your .shtml file. <!-- #exec CGI="/cftemplate.cfm" --> Be sure to use an absolute pathway, "/template.cfm" instead of a relative pathway "../directory/template.cfm", as a relative pathway will not work. |
||||||||||||
|
|
|||||||||||||
| Included Files |
|
jamie
HostMySite Sales Rep
![]()
|
Would this work on other included file types, such as .cgi
|
||||||||||||
|
|
|||||||||||||
|
steve
HostMySite Developer
|
You can include pages in a cgi-bin directory such as Perl and CGI in the same manner:
<!--#exec cgi="/cgi-bin/script.pl" --> <!--#exec cgi="/cgi-bin/script.cgi" --> |
||||||||||||
|
|
|||||||||||||
|
byron
Forum Admin
|
Something that came up as a problem when doing this for us. Every call made by the .shtml file using exec will act as a new call to CF. We we're getting a ton of client variables created in the db because each include acts like a http request.
Since there is no way for a cookie to be returned and set by the calling .shtml file each request has a new cfid and cftoken. Just something to look out for. |
||||||||||||
|
|
|||||||||||||
| Including .cfm templates in .shtml files |
|
||
|



