Link to home
Start Free TrialLog in
Avatar of Mike Waller
Mike WallerFlag for United States of America

asked on

call a cfm page inside php page

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.
<?php
//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\'>
<tbody>
<tr>
<td height=\'1\' colspan=\'3\' width=\'960\' bgcolor=\'#72D4EA\'></td>
</tr>
<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>
</tr>
</tbody>
</table>';
}
?>

Open in new window

Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

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.
Avatar of Mike Waller

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
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
good call.  I was wondering if there was like #include file.cfm I can just add in there but maybe not
Avatar of dagaz_de
dagaz_de

how about fopen

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