call a cfm page inside php page

Posted on 2011-04-28
Last Modified: 2012-05-11
In my wordpress site, in my functions.php page, I've created a table so I can serve up some cookie data.  However, I need to invoke a coldfusion script instead.  Can I place an include inside that echo so that it reads my cfm page? basically, where the beginning and ending table tags are.

so the page would serve up everything inside that php page but also whatever is called inside my cfm page.
//customize header
remove_action('genesis_header', 'genesis_do_header');
add_action('genesis_header', 'child_do_header');
function child_do_header() { 
echo '<table cellpadding=\'0\' height=\'122\' cellspacing=\'0\' border=\'0\' width=\'960\' align=\'center\'>
<td height=\'1\' colspan=\'3\' width=\'960\' bgcolor=\'#72D4EA\'></td>
<tr class=\'headertext_b\'>
<td width=\'331\' height=\'122\'><img src=\'/images/header/left.png\' border=\'0\'></td>
<td align=\'center\' width=\'456\' height=\'122\' background=\'/images/header/middle.png\'>
<div style=\'padding-top:62px;\'>Call ' . (($_COOKIE["FIRSTNAME"])?$_COOKIE["FIRSTNAME"]." ".$_COOKIE["LASTNAME"]:'title') . " at " . (($_COOKIE["PHONE"])?$_COOKIE["PHONE"]:'303-996-1900') . '</div></td>
<td align=\'right\' width=\'173\' height=\'122\' background=\'/images/header/right.png\'><div style=\'padding-top:62px;\'>303-996-1900</div></td>

Open in new window

Question by:COwebmaster
    LVL 70

    Expert Comment

    by:Jason C. Levine
    Is the domain able to parse cfm files?  If so, and assuming the cfm is returning pure data and no headers it should be possible.   But in a cross-domain situation, I doubt that it will work as intended.

    Author Comment

    it would be the same domain.  the server can run both cfm and php.  the cfm page is in the root directory with the other php pages.  My question is how would I call that in that script?
    LVL 70

    Accepted Solution

    >> My question is how would I call that in that script?



    Author Comment

    good call.  I was wondering if there was like #include file.cfm I can just add in there but maybe not
    LVL 3

    Expert Comment

    how about fopen

    $fp = fopen("http://www.yourdomain/yourfile.cfm","r");

    Author Closing Comment


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    In Part I (, I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now