PDA

View Full Version : PHP Includes dont show


xhan104
09-09-2007, 01:10 PM
I've just done a fresh brand new install of PP 1.6.0 but I'm having a few issues with PHP includes.

I want to include a contact form (I'm using Dagon Designs form mailer:
http://www.dagondesign.com/articles/secure-php-form-mailer-script/ )

The instructions call for using a PHP include and thats what I've done but it doesn't seem to want to work, the URL is correct. I've also tried paths.

<?php include('http://www.apricot13.org/templates/simple/dd-formmailer/dd-formmailer.php'); ?>

You can see the page here:
http://www.apricot13.org/index.php?x=contact

How can I get the form to work?

Dennis
09-09-2007, 02:00 PM
Due to security reasons PHP statements are not allowed in the templates.

This sort of things has to be done by an addon. In your case I would replicate the echo of the dd-formmailer.php file (the form), put that in a variable and replace a tag (e.g. <DD_FORMMAILER> ) in the template with the contents of the variable.

xhan104
09-09-2007, 04:11 PM
Thanks Dennis+ I tried to make an addon but theres not really an adequate resource on the topic! I tried butchering other addons but I gave up and used a different formmail!

I'm more of a C gal!

dhdesign
09-09-2007, 06:04 PM
I'm using the same formmail script from Dagon Design on my blog. I had to create a new page called contact.php in order for it to work.

You'll need to take the code from page you've created (contact_template.html), including your php include for the form, and save it as contact.php. Just remember to include the html from any of the PP tags (site title, rss/atom feeds, archive nav, etc.) in your page, as those tags won't work otherwise.

Upload contact.php to your server in the same folder as the main index.php file and test it out to make sure it's working properly.

If you have any other questions, just give a shout!

GeoS
09-09-2007, 08:21 PM
Other solution is to tell to the server that it should parge xxxyyyzzz_template.html as PHP script. Then it should be parsed by Pixelpost and should give all PHP flexibility.