
Originally Posted by
RSimoes
I'm interesting in including PHP outputs in a branded cpanel index.html file. When inserting lines like the following in an html file:
Code:
<cpanel relinclude="foo.php">
<cpanel Branding="include(foo.php)">
the included php file doesn't get executed (the source is included). Is there any way to get the expected result; i.e., the php file getting executed, and the output getting included?
This thread has a proposed solution, but it doesn't work.
Could use .cpphp so cpanel processes the file first and the php gets executed.
You you have other options:
You can just call your file
.php
.cpphp
.phpcp
.live.php
Depending on what order you want the php engine to run and which engine you want to use.
x3/test.live.php
x3/test.php
are good examples.
The live one is inlined below:
Code:
<?php
include("/usr/local/cpanel/php/cpanel.php");
$cpanel = &new CPANEL();
print_r ( $cpanel->exec('<cpanel print="cow">') );
print_r ( $cpanel->exec('<cpanel Branding="file(local.css)">') );
print_r ( $cpanel->exec('<cpanel Branding="image(ftpaccounts)">') );
print_r ( $cpanel->api2('Email','listpopswithdisk',array ("acct"=>1) ) ) ;
print_r ( $cpanel->fetch('$CPDATA{\'DNS\'}') );
print_r ( $cpanel->api2('Ftp','listftpwithdisk',array ("skip_acct_types"=>'sub') ) ) ;
$cpanel->end();
?>