Hi,

I have set the input format for my node to php for the field in question but the php is just displaying as viewable code rather than executing. Is there are setting somewhere else in 4.7.x or am I missing something fundamental?

I have tried this in a page and a block but no luck.

Any help greatly appreciated

Paul

Comments

pwolanin’s picture

Did you put in the PHP tags around your code: <?php ?>

---
Work: BioRAFT

pdjohnson’s picture

Yes,

I think I have done it all right ;-(

PJ

--Paul Johnson

pwolanin’s picture

Do you have the codefilter module installed?

---
Work: BioRAFT

pdjohnson’s picture

I do not have the code filter installed, should I?

--Paul Johnson

pwolanin’s picture

No- this is the filter used, for example, on drupal.org so that code is escaped and syntax colored.

---
Work: BioRAFT

nevets’s picture

Also need to set input format to 'PHP code'

pdjohnson’s picture

I turned off FCKeditor and the php works. I guess there is a fillter or code rewrite going on which is spoiling things. Thanks for all the suggestions.

--Paul Johnson

rszrama’s picture

Aye, you can't use a rich text editor (like FCK) because it automatically turns your < and > signs into their HTML character strings... &lt; and &gt. Hence the code never getting parsed... it wasn't really enclosed by the right tags. ; )

----------------------
Current Drupal project: http://www.ubercart.org