Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-08-13 11:02:59

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

PHP code in template page

I’ve created a poll system with PHP and now want to embed that to the website.
i’m adding php code to the page (template) of textpattern, but not working fine, even i enabled php code from Preferences.

<txp:php>
require('library/function.php');
poll(1,1);
</txp:php

note: poll is a custom function.

Offline

#2 2014-08-13 11:16:03

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: PHP code in template page

raminrahimi wrote #282880:

but not working fine

</txp:php

Is that missing closing angle bracket a copypaste error?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2014-08-14 06:30:28

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: PHP code in template page

raminrahimi wrote #282880:

I’ve created a poll system with PHP and now want to embed that to the website.

Are the file permissions correct on function.php – is anything added to your http access log? Can you do a simple proof of concept to see if any PHP is possible:

<txp:php>
$testString = "foo";
echo $testString;
</txp:php>

Offline

Board footer

Powered by FluxBB