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 »
  • How to include non-file variables in a droplet
  • Print
Pages: [1]   Go Down

Author Topic: How to include non-file variables in a droplet  (Read 4848 times)

webkitchen

  • Guest
How to include non-file variables in a droplet
« on: May 29, 2010, 06:24:50 AM »
I am loving WB, but am not that good with PHP. There probably is a very easy way to do this:

I want to store some values in a hidden code section of a page and then retreive them as variables in a droplet.
So for example.
Code section of page contains
$name="xxx";
$address="yyy";

I want to run a droplet that uses these variables at the start of the droplet.

I know how to get the contents of the code section from the database but I want to do the equivalent of php 'include' using from the database (code section) contents.
Maybe someone can point me in the right direction.
Will I have to use serialize to retrieve and store the data and if so, can anyone give me a simple example.


Many thanks
Rodney
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: How to include non-file variables in a droplet
« Reply #1 on: May 30, 2010, 12:14:46 AM »
You could use sessions..

in the code section use:
$_SESSION['name'] = 'xxx';

in your droplet use:
if(isset($_SESSION['name'])) {
  
$name = $_SESSION['name']
}
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • How to include non-file variables in a droplet
 

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