I’am developing a module for Drupal which provides a login form and after submission user cURL to login in with those credentials on another website.
If all goes well, the module redirects the user to their profile and should present the information cURL fetched. This is where things go wrong.
What I’m trying to do is get the $account variable through the username. This is all in the module_name_form_submit function:
$account = user_load(array('name' => check_plain($user)));
And then append the data I want to display to it:
$account->content['module_name'] = array(
'#title' => t('Module Title'),
'#values' => get_info()
);
If I do a print_r before the redirect, sure enough, the data is there as it should. But after the redirect:
$form_state['redirect'] = "users/{$user}";
I no longer have access to that same data. So the question is, how can I set that variable in a permanent way and access it after the redirect in the user profile page? (I’m trying to avoid sessions).
Thanks in advance 🙂
How about use variable_set($name, $value); According to your question:
When you need to access the data use variable_get($name, $default); As per your question:
please let me know if it works for you.
Thanks