Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
That is a bit of a vague question. What do you mean by use PHP, what are you seeking to do? If you want to alter that page and put dynamic elements in there with a custom module you will have to use hook_form_alter.
Thx 4 response...here i have a requirement to use Varialbles in the Block. So i added a new block, in that i wrote php code and applied PHP filter in Input Format. But its not applying in the block(it is printing with php tags as normal text in the block).
Just create a block ("Add block"), select "Php code" in the "Input format" section (if you have permission for that or if you are user 1), and put your code in the block's body, inside <?php ... ?> tags.
You didn't mention your Drupal version. If it is an older version, test your code on a page first, because if it contains any serious errors and is rendered on all drupal pages, you may be unable to access the block to fix the code.
If you are using Drupal 6, make sure to enable the "PHP filter" module in admin/build/modules
Yeah!! created a new block as u suggested. I selected PHP as Input Format filter. But It is Displaying with PHP Tags in the block a Normal Test. I am using Drupal 6.x. i enabled PHP filter module,but no use.
Go to the admin/settings/filters page and then "configure" the "PHP code" input format and make sure that only the "PHP evaluator" filter is selected in it and no other filter.
Comments
That is a bit of a vague
That is a bit of a vague question. What do you mean by use PHP, what are you seeking to do? If you want to alter that page and put dynamic elements in there with a custom module you will have to use hook_form_alter.
I need to create a block with PHP Content
Hi papile,
Thx 4 response...here i have a requirement to use Varialbles in the Block. So i added a new block, in that i wrote php code and applied PHP filter in Input Format. But its not applying in the block(it is printing with php tags as normal text in the block).
thx again,
Rams
Just create a block ("Add
Just create a block ("Add block"), select "Php code" in the "Input format" section (if you have permission for that or if you are user 1), and put your code in the block's body, inside
<?php ... ?>tags.You didn't mention your Drupal version. If it is an older version, test your code on a page first, because if it contains any serious errors and is rendered on all drupal pages, you may be unable to access the block to fix the code.
If you are using Drupal 6, make sure to enable the "PHP filter" module in admin/build/modules
PHP filter selected... butDispalying as Normal Text in the block
Hi rusty,
Yeah!! created a new block as u suggested. I selected PHP as Input Format filter. But It is Displaying with PHP Tags in the block a Normal Test. I am using Drupal 6.x. i enabled PHP filter module,but no use.
thanks,
Rams
Go to the
Go to the admin/settings/filters page and then "configure" the "PHP code" input format and make sure that only the "PHP evaluator" filter is selected in it and no other filter.
thanks
thanks