Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 09:41:32 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155535 Posts in 21713 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: How to include non-file variables in a droplet  (Read 606 times)
webkitchen

Offline Offline

Posts: 8


« on: May 29, 2010, 05: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
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2296



WWW
« Reply #1 on: May 29, 2010, 11:14:46 PM »

You could use sessions..

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

in your droplet use:
if(isset($_SESSION['name'])) {
  
$name $_SESSION['name']
}
Logged

Professional WebsiteBaker Solutions
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!