Can't you have PHP in a custom block in drupal 6? I have enabled the php module, selected php code in input format but nothing? Any ideas?

Comments

preventingchaos’s picture

did you remember the php tags?

ggarry’s picture

Yes, I have tried php in a page now and nothing there either

print "hello world";
echo "hello world";

Prints nothing to the screen in both a page and block with "PHP code" selected as input format.

Under input formats I have tried giving anonyomous access to php code and nothing there either.

It is only the "PHP Filter" module I need to enable?

vm’s picture

Are you logged in as the first created user ?

Working with 6.x-dev I just added php and it worked as it has in pervious versions, however, I do not have a 6.0 install only a 6.x-dev install which is a little newer.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

ggarry’s picture

Yes, I just disable the php filter and deleted "php" from my modules file but it still gives me the "PHP code" option under "Input format", surely that isn't right. Will try another install and see if it was a contributed module that is causing it.

ggarry’s picture

OK worked on a clean istall.

preventingchaos’s picture

Same here...

What contrib and core modules do you have enabled?

ggarry’s picture

I can't replicate it, fresh install and the same modules installed/enabled the defaul plus Path, PHP filter and the user contributed Taxonomy Menu.

drdrup’s picture

Drupal 6.0:

Here too: no response to a php code.

I removed all contributed modules; disabled all Core-optional modules except PHP filter 6.0

Still, no output from the php code in the note.

Input format is:
[ ] BBCode
[ ] HTML corrector
[ ] HTML filter
[x] Line break converter
[x] PHP evaluator
[x] URL filter

PHP code
Lines and paragraphs break automatically.
You may post PHP code. You should include <?php ?> tags.
Web page addresses and e-mail addresses turn into links automatically.

I then changed to:
1) [ ] BBCode
2) [ ] HTML corrector
3) [ ] HTML filter
4) [ ] Line break converter <--- unchecked
5) [x] PHP evaluator
6) [ ] URL filter <--- unchecked

(the line numbers 1-6 are just for convenience here)

and IT STARTED TO WORK!!!
I enabled all my various modules. Still WORKING.

I went back and enabled (4) and (6) --- PHP continues to WORK!!
Then, I could not make it not working again, does not matter the settings of (4) and (6) !!!

So definitely (as much as I can see) there is something wrong in the initial status!!

ggarry’s picture

Yes that fixed my original install.

aamohamm’s picture

FCKeditor inserts some html style code . making the code to appear instead of the result