By andremasteredge on
I want to create a link that will always link the current user to their own account page something like http://localhost/drupal/users/ .......I have tried various combinations but I cant seem to get it right.... when I link to my account the address bar shows http://localhost/drupal/users/andre .....I just need to be able to make the link fetch the current username instead of my own....
Would really appreciate the help on this one...
Kind regards,
Andre van Schalkwyk
Comments
If you are doing custom code
If you are doing custom code in a module then use the global user to get the current logged in user and use the l() function to create the link.
Even simpler
The url 'user' always presents the current user's profile page if logged in; else the login form.