I'd like to use Cold Fusion (and a .cfm extension on the page) to do this. Anyone know how this can be done?
It'd be nice if I could use a <cfinclude template = "C:\etc.> but if that's posssible, I haven't figured out how to do it.
Any help is much appreciated.
Thanks,
~Canton
Still don't know if this makes sense...bottom line, however, is I want to be able to change one page in a single location on my server and have it affect many web sites on the server.
Thanks
~Canton
While I haven't used CF in awhile I'm pretty sure you can call pages outside of your web space by using the absolute path. I know PHP will do this quite nicely (I'm a former CF programmer turned PHP programmer). PHP will allow you to include files from anyplace on the server provided you have permission to that dir and file. In fact, I can't think of any scripting language that wouldn't let you do this providing you have permission.
Have you tried entering the absolute path and if so, what did it get you?
I tried a physical path a URL and got this error message:
----------------
Error Diagnostic Information
Physical paths are not allowed in CFINCLUDE and CFMODULE
The path you have specified 'http://www.website.com/page.htm' is a physical path that points to a specific drive on your system. Only logical paths are allowed in this context. They can be relative (calculated from the current directory of the base template) or absolute (calculated using the ColdFusion mappings).
---------------------
I'm going to look into ColdFusion mappings, but I'm extremely knowledgeable on this issue...any advice on that front?
Thanks in advance
~Canton
When a user requests any .cfm page the server checks that files folder for Application.cfm. If it finds one it includes it, if not it searches the parent folder. If it is found there it will be used, if not it searches that folders parent folder and so on all the way up your file structure (and it doesn't stop at your web root folder either, it goes right back to the c:\).
Most ColdFusion developers sit a <!--- Commented application page at the web root folder to stop the search going any futher back --->. If you are only serving up on site you are able to use it for items on all pages.
A basic example is if you are using one datasource for all of your querries (you can include more if you use more datasources) In the Application.cfm page include
<!--- This is the root application page --->
<cfset DSN="mydatasource">
<cfset DSN2="myotherdatasource">
Then when you run a query you just put
<cfquery name="myquery" datasource=#DSN#>
and mydatasource is automatically included. If for some reason you change your odbc datasources you only need to update the application page and all queries will be working fine again.
I hope this helps.
***note, you can not request a application.cfm page through the browser either ***