views:

21

answers:

3

After registration the user is redirected to a welcome page . How to get display the respective user details in redirected(welcome) page?.

for ex: welcome username . how to get user name in redirected page

+2  A: 

When a user is logged in, you always have the global $user object available. So all you really need to do, is to access it and insert the name.

I'm not sure what page your users are redirected to, you can change that, but to alter the output you only need the normal theme/template overwrites that you can do with Drupal.

googletorp
And it would probably be a good idea to have your "Welcome, X" in a block. That way, you won't have to modify the templates at all.
Hugo Estrada
@Hugo Estrada: You could also just use `drupal_set_message` for a simple solution.
googletorp
+1  A: 

We do this using the Profile, Blocks, and Views modules. A view could include only the logged in username as you require, but ours also includes several profile fields that logged in users may choose to complete. The view has a block display - we configure that block to display only on certain page paths through the block administration screens.

Craig Hyatt
+1  A: 

You can use actions, and triggers.
Using them, you can define an action (show message to the user) that is triggered when a user logs in. The action to show a message to the user allows you to use tokens; one of them is for the username.

kiamlaluno