Hi,

How do I add php in drupal blocks?

Comments

jpshayes’s picture

Enable the php filter module. After you enable it, php with be available in your input formats

S2eve’s picture

thanks ...
but now i have this error
warning: include() [function.include]: URL file-access is disabled in the server configuration

nevets’s picture

That means you can only include files relative to your web sites root.

S2eve’s picture

how to fix this?
it's a simple script, in html it works fine
include("http://link.com/posts.php");

nevets’s picture

Assuming your site is http://link.com you would use include("/posts.php");

shazar’s picture

That doesn't make any sense... Why would you include a processed php page? If you did want to print the results of a php page, I would think you would make use something like echo file_get_contents('URL').

S2eve’s picture

figure this one... thanks for the support

jpshayes’s picture

Could you share with us how you fixed it? It might help the next drupaler out?

S2eve’s picture

sure, I used file_get_contents instead