Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-06 23:00:06

rvturnage
New Member
Registered: 2009-01-06
Posts: 5

PHP error in taghandlers.php

Hi all…brand new to textpattern. just installed it yesterday. I’m trying to add some custom php code and get this error whenever I try:
Parse error: syntax error, unexpected ‘<’ in /usr/local/apache2/htdocs/textpattern/textpattern/publish/taghandlers.php(3082) : eval()’d code on line 1

Any ideas? Thanks in advance! I’m really digging how straightforward Textpattern seems to be!

rvt

Offline

#2 2009-01-06 23:24:14

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: PHP error in taghandlers.php

Are you using txp:php


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2009-01-07 00:24:43

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: PHP error in taghandlers.php

MattD wrote:

Are you using txp:php

And specially with out <?php ?> signs and syntax. That error sounds that you are using <txp:php><?... when you shouldn’t use <? nor <?php, but only <txp:php>....</txp:php>.

Offline

#4 2009-01-07 01:02:33

rvturnage
New Member
Registered: 2009-01-06
Posts: 5

Re: PHP error in taghandlers.php

Yeah, I double checked that. Even cut and pasted from the textbook, just to be sure I coded it right. I’m using txp:php, and I’m not using php tags. I’m perplexed…
<txp:php> echo "help"; </txp:php>

does not work. Gives me the same error.

Oddly enough, if I have an empty space before the echo statement, I get this error (& instead of <, and line 2 instead of 1):

Parse error: syntax error, unexpected ‘&’ in /usr/local/apache2/htdocs/textpattern/textpattern/publish/taghandlers.php(3082) : eval()’d code on line 2

Thanks for the suggestions. Got anymore ;)

rvt

Last edited by rvturnage (2009-01-07 01:02:54)

Offline

#5 2009-01-07 01:08:16

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: PHP error in taghandlers.php

  • Are you using that code inside article?
    • If yes, u need to escape or turn off Textile; notextile. <txp:php></txp:php> or ==<txp:php></txp:php>==.
  • Have you allowed PHP from Textpattern’s preferences?

Last edited by Gocom (2009-01-07 01:11:08)

Offline

#6 2009-01-07 01:19:08

rvturnage
New Member
Registered: 2009-01-06
Posts: 5

Re: PHP error in taghandlers.php

That’s it! I was using it in an article and must have overlooked that it needed to be escaped if used in an article…works like a charm now!

Thanks, Gocom!

rvt

Last edited by rvturnage (2009-01-07 01:19:35)

Offline

Board footer

Powered by FluxBB