PDA

View Full Version : Can I use PHP includes in bad_template?



artlab
02-May-2006, 11:31 PM
I am trying to use bad_template for handling errors.
<input type="hidden" name="bad_template" value="my_bad_template.php" />

However my website uses PHP includes to generate the headers and navigation.
bad_template does not seem to let you use PHP in the template

<?php require($_SERVER['DOCUMENT_ROOT']."/includes/header.tmp"); ?>
is not processed through formmail with bad_template.

How do I get this to work?

artlab
02-May-2006, 11:40 PM
I found the answer:

You must set templateURL and not TemplateDir in formmail. If you use TemplateDir, it will not parse PHP code.