form alter user login drupal 6 I have added this:

    function ahml_form_alter(&amp;$form, $form_state, $form_id) {
      if ($form_id == 'user_login') {
        $form['my_field'] = array(
        '#type' =&gt; 'link',
        '#title' =&gt; t('Example link'),
        '#href' =&gt; 'login'
      );
    }


into a custom module and instead of a link in the output I have two text boxes: one reads 
"example link title", the other "example link url".

Do I have this wrong of is there just something else in the system causing this to happen?
I recommend you to write the function as follow:

function ahml_form_alter(&amp;$form, $form_state, $form_id) {
  //for register page
  if ($form_id == 'user_register') {
    $form['my_field'] = array(
      '#type' =&gt; 'markup',
      '#value' =&gt; l('Login page', 'user/login'),
    );
  }
  //for login page
  if ($form_id == 'user_login') {
    $form['my_field'] = array(
      '#type' =&gt; 'markup',
      '#value' =&gt; l('Register link', 'user/register'),
    );
  }
}


For additional details, check Drupal 6 Form API Reference