Is it possible to include a php file in a document?
Quote from: banzai at Jun 27, 2005, 12:35 PM
Is it possible to include a php file in a document? 
Sure you can.
1) Create a TV called MyFile
2) Inside the default value enter @EVAL include ’yourfile.php’;
3) Save the TV
4) Edit the document and add [*MyFile*] inside it’s content
5) Save document
That’s it!
Thank very much i’ll try it
..included file appears in the top of the page
Quote from: banzai at Jun 27, 2005, 01:07 PM
..included file appears in the top of the page 
Change the @EVAL to :
@EVAL
ob_start();
include "yourfile.php";
$rt = ob_get_content();
ob_end_clean();
return $rt;
Hi, I want to include a php file that uses another database and I get an error stating a table it uses doesn’t exist, plus another error about myssql_free-result..even though the later works perfectly in the other program which is in a folder inside the modx(root) folder. Basically I’m trying to call up the minicart that works with the shopping cart(other program).
Any ideas are welcome.
Tracyjs
Maybe I’m misunderstanding you, but why not put the php code in a snippet and include a call to that snippet in the document?
You can’t use EVAL in a snippet, remove that line, the rest should be OK, if you need to use the $modx object put ’global $modx’ as the first line
Use MODx, or the cat gets it!