View Single Post
  #1  
Old 07-17-2016, 01:24 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 460
 

Default Adding a new page that contains a php code?

The knowledge base has this page explaining how to add new page.

It works fine if I only put html contents in the page, but would there be
any way to put php code in the new page?

For example, if I put
Code:
<? echo "hello world"; ?>
in the body.tpl, then I get an internal error on the new page. Putting
the same code in the viewer, at the end of the file, gives what I expect. However, if I put
Code:
<? $a="hello world"; echo $a; ?>
instead, then the entire site gets messed up. Would anyone know how to achieve this? Thank you in advance.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France