php - Send variable to the user profile in Drupal 6
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 themodule_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 aprint_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 :-)
Answer
Solution:
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
Answer
Solution:
Maybe you could use the value form element to add the user value to your form.
I think this may do what you are looking for in a 'drupalish' way.
Hope it helps, good-luck!