You would need to create a plugin and use the event hooks in joomla. So trigger the event and it will talk to your plugin and do w/e it is you want in this case take some user details.
I don't know how to help you code it out if you don't post code so here are some good links to take a look at
Documentation on user events ---> http://docs.joomla.org/J1.5:Plugin/Events/User
Documentation on events ---> http://docs.joomla.org/Plugin/Events
Notice a lot are being "moved" so click through the links to get to the new pages and notice the name changes in the deprecated events.
Hope this helps and post back some code for more feed back.