WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Calling PHP code in droplet and security?
  • Print
Pages: [1]   Go Down

Author Topic: Calling PHP code in droplet and security?  (Read 5282 times)

MarkPrima

  • Guest
Calling PHP code in droplet and security?
« on: May 13, 2011, 09:43:10 PM »
Hi everyone,

I have read about security using the include call in a droplet.
But I was wondering if this can be a droplet " <?php include("includes/file.php"); ?>

Ultimately, I would like to use this to include a contact form.

Thanks
Logged

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Calling PHP code in droplet and security?
« Reply #1 on: May 19, 2011, 07:21:06 PM »
sorry missed this post, ah well, better late then never ;)

To only include a file as a droplet seems a bit weird, maybe better
to open the file, copy the contents to a droplet, remove the <?php ?> php tags
check for echo's since a dorplet can't echo

Maybe better to copy the content into a code section?

If yo uneed to include a file make sure paths are correct!
Sometimes a matter of trial and error.

John
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

NorHei

  • Guest
Re: Calling PHP code in droplet and security?
« Reply #2 on: May 19, 2011, 08:16:41 PM »
If the include is specially build for use in a droplet this is posible, otherwise you have to use this:
Code: [Select]
ob_start();
include("includes/file.php");
$output=ob_get_contents();
ob_end_clean();
return $output ;
A droplet expects you to return a value just like a function does.
Logged

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Calling PHP code in droplet and security?
« Reply #3 on: May 19, 2011, 09:55:51 PM »
ps, that security issue you referring to is:
in wb3 changes are commands like eval and include will be forbidden in droplets and code

In wb2.8 (current stable) it is still allowed as are all php commands.
Droplets don't echo output direct, they return output instead.

There are some debates about wanting this 'feature'


John
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

NorHei

  • Guest
Re: Calling PHP code in droplet and security?
« Reply #4 on: May 19, 2011, 10:26:04 PM »
As Droplets is a Modul you can still install a version whithout that problem .
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Calling PHP code in droplet and security?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2