Mixing cold fusion headers and footers with PHP body

danpman
danpman used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You could try putting the PHP page in an Iframe on the CF page.
Most Valuable Expert 2015

Commented:
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.

Author

Commented:
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
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Most Valuable Expert 2015

Commented:
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.
Most Valuable Expert 2015

Commented:
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.
Fixer of Problems
Most Valuable Expert 2014
Commented:
I would generate a page with the header and the footer and a blank space in between, grab the 'View Source', and use that as the basis for the PHP page.  I've done that with other pages quite a number of times.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial