How to alter a form depending how it was accessed I would like to alter the login form depending how it was accessed. As an example, if the form was access from a particular link, it would display the standard login form. If it was accessed from a different link, then the login form would be modified (ie maybe display a different title and exhibit different behaviour (redirects based on role)). 

I figure I need to use hook_form_alter() but I am not sure how to tell which link was clicked. Any ideas how one would go about accomplishing this? I am working with Drupal 6 by the way.

Thanks
Inside your form_alter() hook, you can always check what page a form is on by looking at $_GET['q'], eg:

if ($form_id=='user_login' &amp;&amp; $_GET['q']=='different/link') {
  // do form alters here
}


so if you are at www.yourhost.com/different/link, it will do whatever you tell it to do.