1) Added a block via "add nlock"
2) Made the input format be PHP
3) Entered appropriate visibility settings
4) If the "Block body" field contains plain text or HTML, it shows up correctly BUT
5) If the "Block body" field has PHP code (inside PHP tags), it NEVER executes

Using Drupal 4.7.6.

Please help! Thank you!

Comments

nevets’s picture

Unless you set the input format to 'PHP code' it will never execute.

ardee-1’s picture

It is set to PHP!

This code:

hi<?php print ' de'; ?> ho

generates this result:

hi ho

whereas it should generate this:

hi de ho

Could my database be corrupt? Could my Drupal install be broken somehow??

agentrickard’s picture

I couldn't replicate this error (I copied your code into a new block). Some additional checks:

1) No, it isn't a database problem.

2) Your Drupal is probably not 'broken,' but some setting is interfering with normal operations.

Are you using a default theme, or have you made modifications to block.tpl.php?

Check to see if you have changed any settings for the PHP Code filter at admin/filters/2. You may have to enabled some role-based permissions on that page.

This last bit will probably fix it.

--
http://ken.blufftontoday.com/
http://new.savannahnow.com/user/2
Search first, ask good questions later.

ardee-1’s picture

Oh my god!

When I installed Drupal several weeks ago, I apparently turned off PHP input -- even for the "PHP code" input format! I guess I was trying to be "safe" (d'oh!). I promptly forgot about having done that. This not only explains the problem I've been having here, but also a problem I was having with CCK Computed Types!

How can I thank you enough? You saved my butt big time. I am eternally grateful!!

agentrickard’s picture

ardee-1’s picture

As soon as the site is up and generating income, you'll be remembered. :-)