troubleshooting Question

read and write a cf page?

Avatar of pigmentarts
pigmentartsFlag for United Kingdom of Great Britain and Northern Ireland asked on
Web Development SoftwareWeb ServersColdFusion Language
2 Comments1 Solution243 ViewsLast Modified:
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


    <cffile
     action = "read"
      file = "#productPageTemplate#"
      variable = "productPageContent"
       >
   

      <cffile action="write"
                        output="#productPageContent#?prodId=#prodId#"
                        file="#productPageLocation##productPageName##productExt#"
                        nameconflict="overwrite">
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros