Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-07-08 11:59:25
- urkozamanje
- New Member
- Registered: 2006-05-17
- Posts: 2
problems with implementing php code with classes
i have some class for xml parsing, and it works without any problem until i try to implement it in tetxpattern.
for example i have that class : XML-parser.php and a file tabela.php
so i made a form :
< t x p : p h p >
include(‘files/XML-parser.php’);
include(‘files/tabela.php’);
< / t x p : p h p >
but when i try to view it shows an error:
An error occurred in the following tag: <txp:php> -> Notice: Trying to get property of non-object
Parse error: parse error, expecting `T_STRING’ or `T_VARIABLE’ or `’$’‘ in C:\webroot\alco_txp\files\XML-parser.php(21) : eval()’d code on line 1
An error occurred in the following tag: <txp:php> -> Notice: Undefined variable: test
Parse error: parse error in C:\webroot\alco_txp\files\XML-parser.php(95) : eval()’d code on line 1
Parse error: parse error, expecting `T_STRING’ or `T_VARIABLE’ or `’$’‘ in C:\webroot\alco_txp\files\XML-parser.php(21) : eval()’d code on line 1
An error occurred in the following tag: <txp:php> -> Notice: Undefined variable: test
Parse error: parse error in C:\webroot\alco_txp\files\XML-parser.php(95) : eval()’d code on line 1
Parse error: parse error, expecting `T_STRING’ or `T_VARIABLE’ or `’$’‘ in C:\webroot\alco_txp\files\XML-parser.php(21) : eval()’d code on line 1
etc. etc….
does txp maybe have some protection for using eval() or something?
Last edited by urkozamanje (2006-07-08 14:15:57)
Offline
Re: problems with implementing php code with classes
does txp maybe have some protection for using eval() or something?
No. txp:php uses eval itself to evaluate the php code within the tags. There is no extra “protection” or restrictions.
Maybe you have a scope issue? Can’t tell without any of the relevant code.
Offline
#3 2006-07-08 13:52:12
- urkozamanje
- New Member
- Registered: 2006-05-17
- Posts: 2
Re: problems with implementing php code with classes
if it’s going to help, these are url’s to php files that i use:
http://www.webprezentacija.com/files/parsing_files.zip
i would be sooooooo grateful :))
Last edited by urkozamanje (2006-07-08 13:55:16)
Offline
#4 2006-07-09 03:56:45
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: problems with implementing php code with classes
Your code includes eval() calls, they could be causing the errors.
Alex
Offline