read and write a cf page?
Posted on 2007-07-26
I have a dynamic .cfm page, that displays data from DB based on the ID of a product passed in the URL at the top of the page, very simple stuff i.e. product-page.cfm?prodID=1
Now I have another application which I want to get and read the product-page.cfm page, then pass a URL i.e product-page.cfm?prodID=2, save the outputted file, rename it. i.e. I now have a static file called some-product.cfm which is the same as if I have done product-page.cfm?prodID=2?
Does any of that make sense? Well if it does here is tricky part, I still want the new page recreated to be a cf one. i.e its dynamic still not a static output.
Before I did all this with cfhttp read then write the new file, only this method created a static page which cannot process cf after.
so now have this code (below) which works, but the new page I have to still pass a url to get it to do anything
If none of that make sense sorry
action = "read"
file = "#productPageTemplate#"
variable = "productPageContent"