do some work when user login or register in drupal6
In drupal 6, there is a function named hook_user.

By using this hook in your custom module. You can do watever you want. Remember to put condition in this by '$op' like

function hook_user($op, &amp;$edit, &amp;$account, $category = NULL) {
  if($op == 'login') {
    //do watever you want
  }
}