I guess I should clarify:
My this is my snippet:
<?php
include_once($modx->config['base_path'].'assets/quoteForm/scripts/instruments.php');
?>
This snippet is supposed to grab some form data, create a session array storing the information and then query the database to fill a PEAR HTML Template IT. I can put echo statements all over the place showing that my code is querying the database and that it is finding the template and loading the template just fine, then if I put a
right before the last line of my code which is
I can see all my echo’s, and see the info pulled from the database. If I remove the
statement and let my code finish (showing the template), the error I get is: "Error while inserting event log into database.". Just for kicks, and because I was curious to see what would happen, I changed the path of the template to a path that had no templates (.tpl files) in it. I changed my code from the correct path:
$template = new HTML_Template_IT("assets/quoteForm/templates");
to:
$template = new HTML_Template_IT("assets/quoteForm/scripts");
and then I get a new error message:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: fopen(assets/quoteForm/scripts/instruments.tpl) [function.fopen]: failed to open stream: No such file or directory
Error type/ Nr.: Warning - 2
File: /usr/local/share/pear/HTML/Template/IT.php
Line: 914
Line 914 source: if (!($fh = @fopen($filename, ’r’))) {
Parser timing
MySQL: 0.0036 s (2 Requests)
PHP: 0.0855 s
Total: 0.0891 s
Error while inserting event log into database.
...but notice I get at the very end of that error "Error while inserting event log into database." again. There should not really be a problem I wouldn’t think because I a snippet that calls a PHP script which performs a query on a database, and then populates a template which is just HTML with a few HTML comments and markers ({FOO} and {BAR}) to tell PEAR where to populate. PEAR has horrible documentation, and support online, so I posted this there too, but I am not expecting much help there.
I’m still going at it, but if anyone has thoughts or suggestions, that would be very much appreciated.