I am using a custom module in drupal. where in a function I have used
$GLOBALS['dataCapsue'] = array("some", "data", "here");
And then did a drupal_goto redirect to another url of my custom module. When i re declare global variable as
global $dataCapsule;
in another function. It returns NULL. What may be the cause of this issue. Am I missing something?
Thanks
Global variables are not persistent between http requests, like a redirect. You have to use a session to store this data between requests.
Use a $_SESSION
variable or a browser cookie to get the stored data on the other site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With