Posted by eugen80 on February 5, 2010 at 9:54am
Hi,
i'm new to rules, i'd like to set a var on one page (an author-id) and read it on next page.
If i try to echo or var_dump the created var, i get NO output (even lines like echo "hello"). http://pastebin.com/m7677e84d What am i doing wrong?
Comments
If you're talking about D7,
If you're talking about D7, then probably output buffering is used.
Use e.g. ob_flush() after your var_dump() to display.
dpm
I don't know much PHP, but I've seen developers using the function dpm($whatever) to get a nice printout of Drupal variables. To use this you must have the Devel module installed.
Consider the function an extended print_r that fits well in Drupal.
//Johan Falk, Sweden
Re: dpm
Yep the devel module is worth a try but I'm not sure if entire arrays will be nicely output in a call to drupal_set_message() which is used by dsm() / dpm().
Ok, another take
If I understand the situation correctly you are doing two things that make your problem unneccessarily complicated:
What I recommend doing:
The message will automatically be displayed to the user on the next page load, so there is no need to save it (manually) in any variable.
I hope this might clarify things...
Good luck!
//Johan Falk, NodeOne, Sweden