I want to embed php code in a content area. The php code is getting filtered. I went to the Input Formats page in the Site Administration area (I am the administrator) but "php code" was not one of my options (and it is not an option on my content pages even though I am the administrator). Any idea why?

How do I allow myself as the administrator to embed php code in content?

Note: Drupal was installed for me. Is is possible that the person who installed Drupal removed php code as an option, even for the administrator?

Thanks for your help!

Comments

dwees’s picture

In Drupal 6, the Php filter is not enabled by default. You need to go to the admin/build/modules page and enable the Php Filter module. It will then automatically create the Php input filter.

If you are using Drupal 5 or earlier, then yes, it has probably been removed or you may not have access to it. You may have to go to the Access Control page and give your user role access.

Hope this helps.

My site: http://www.unitorganizer.com/myblog

mennonot’s picture

Dwees,

Thanks for this clarification. After upgrading from Drupal 5 to Drupal 6, all of our php header and location redirects stopped working and I couldn't figure out why until I found this comment. The PHP input format was still there and I had just assumed it worked the same way it did in Drupal 5. Turning on the module and adding the input filter to the old PHP input format fixed it.

uwgenetics’s picture

THe WYSIWYG editors such as YUI seem to muck up php code. Be sure to turn them off before you start coding in php...

gecko001’s picture

crap!
I disabled fckeditor and enabled php added the php then added php to my block.
Now i cant get fck to show up on any node, just a big empty space. :-(