[support] php-code in block is not executed...

Warren Vail warren at vailtech.net
Thu Jan 20 08:54:56 UTC 2011


Thought I'd just ask the unasked question, does your page contain
vulnerabilities that can be exploited by hackers, vulnerabilities that could
compromise your drupal site?  Just for one example, does it allow loading
your site disk with hundreds/thousands of space consuming files?

 

Warren Vail

  _____  

From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Mr. Jarry
Sent: Thursday, January 20, 2011 12:23 AM
To: support at drupal.org
Subject: Re: [support] php-code in block is not executed...

 

You say block with php-script is bad idea, module is preferred solution.
Unfortunatelly writing modules goes far beyond my capabilities (i'm quite
new to drupal, and what is even worse, to php too). 

But what about creating block with iframe which calls this script within?
Would it be better solution, than block with php-code? I could even move
that script completely away, to different web-vhost (on the same physical
server). In such a case, if that script fails, it should not crash the whole
web-page, only that frame, I think...

That php-script works, when I call it directly. It does not need mysql,
only its own subdirectory structure, with files. I just want to include it
on my web-page, but rewriting it to module would take me at least
a few months...

Jarry

On Wed, Jan 19, 2011 at 8:40 AM, Mukesh Agarwal <mukesh.agarwal17 at gmail.com>
wrote:

I second Fred. Making a module is always a good idea. The code gets compiled
before whereas in case of block, only while execution does the code get
loaded from db and then is compiled and executed. I think the php
accelerators like eaccelerator and stuff will not be able to cache the op
code from the code which is saved in db. 

 

On Wed, Jan 19, 2011 at 4:31 AM, Fred Jones <fredthejonester at gmail.com>
wrote:

>> In general tho mate, this is bad practice.  Put it in code somewhere,
>> not in a block. (like page.tpl.php or node.tpl.php).
>
> But where? And how can I have it displayed where I want,
> like blocks? I'm quite new to drupal...

Make a module and use:
http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_bl
ock/6

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110120/8eb126cc/attachment.html 


More information about the support mailing list