Link to home
Start Free TrialLog in
Avatar of danpman
danpman

asked on

Mixing cold fusion headers and footers with PHP body

I am working on a PHP-based shopping cart that is integrated with a ColdFusion-rendered online catalog.  When the user is checking out their order, I have been asked to use the ColdFusion headers and footers (developed a long time ago) with the PHP-rendered body.  

Is this even possible?  Any hints would be greatly appreciated!

Thanks,

-Dan
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You could try putting the PHP page in an Iframe on the CF page.
use the ColdFusion headers and footers (developed a long time ago)

Headers/footers generally bring to mind something static.  What exactly do these header/footers do - in terms of CF code? If they're not dynamic, or user session specific, perhaps you could simply use the HTML generated by those scripts in your php instead.
Avatar of danpman
danpman

ASKER

Thanks to everyone for your responses.  To answer _agx_'s question - the headers and footers are static - just links and menu options with some rollover effects.

How would I capture and use the HTML generated by those scripts?  Just render the header and footer and 'save-as' the resulting HTML?  Or call the CF script from the PHP code?

Much appreciated!

-Dan
Yes, "save as" is the quick and easy way.  If you had a lot of files I'd say use curl and save the generated html files programmatically, but for a single header and footer it's probably not worth it.

BTW, be warned, old CF code has a tendency to generate a lot of white space in the generated HTML. It won't hurt anything, but you may want to run them through a regex to reduce the .html file size.
Actually on second thought, ... you also need to check the generated HTML and be sure you grab any linked resources, like images, javascript and/or css files.  Since this sounds like a one time task, a single header and footer page could probably be done manually.  If it's more than that, or that something that's likely to change, I'd look into a programmatic way to grab the html, extract any links then grab the linked resources too.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial