We help IT Professionals succeed at work.

call a cfm page inside php page

Medium Priority
639 Views
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.
<?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

Comment
Watch Question

Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

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

Author

Commented:
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?
Don't talk to me.
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
COwebmasterWeb Manager

Author

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

Commented:
how about fopen

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

Author

Commented:
Thanks!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.