Add <?php ?> script to html page in docpad

64 Views Asked by At

I use docpad to update and publish a small 5 page website. Works great but I am at a loss for how to easily add a piece of <?php ?> script to a specific page. I have a contact form generator in php, just add a small script to the html page where you need it embedded and it works perfectly.

For pages I am using eco with html.md files. I tried using a html only file but the results are the same, the code is being sanitized out.

&lt;?php
$contact_form = 2; // set desired form number.
$contact_form_path = &#39;/home/../../../contact-files/&#39;; // set path to /contact-files/ with slash on end.
require $contact_form_path . &#39;contact-form-run.php&#39;;
?&gt;

Yes, I am using marked but the with the default sanitize = false. I suppose I could try to place it in the template .eco file. Will that work?

Should add, yes I am using a handler in .htaccess file. Manually adding the code piece does work, but it is a pain to have to add it if I regenerate the site files.

0

There are 0 best solutions below