Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6191265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:44:02+00:00 2026-05-24T02:44:02+00:00

i am trying to make a custom login form in drupal-6.22 using Email Registration

  • 0

i am trying to make a custom login form in drupal-6.22 using Email Registration module & using danland theme.

in template.php file i made few changes as

function get_user_login_form() {
  $form_id = 'user-login-form';
  $form = array();
  $form['name'] = array(
    '#type' => 'textfield',
    '#maxlength' => USERNAME_MAX_LENGTH,
    '#required' => TRUE,
    '#size' => 10,
    '#attributes' => array('tabindex' => '1','title'=>'E-mail'),
  );
  $form['pass'] = array(
    '#type' => 'password',
    '#required' => TRUE,
    '#size' => 10,
    '#attributes' => array('tabindex' => '2','title'=>'Password'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t(''),
    '#weight' => 2,
    '#attributes' => array('tabindex' => '3')
  );
  $form['#validate'] = user_login_default_validators();
  $form['#build_id'] = sprintf('form-%s', md5(uniqid(mt_rand(), TRUE)));
  $form_state = array();
  drupal_prepare_form($form_id, $form, $form_state);
  drupal_process_form($form_id, $form, $form_state);
  $out = new stdClass;
  $out->form_start =
    sprintf("<form method='post' accept-charset='UTF-8' action='%s'>",
    url('user/login'));
  $out->form_end = "</form>";
  $out->name = drupal_render($form['name']);
  $out->pass = drupal_render($form['pass']);
  $out->submit =
    drupal_render($form['form_id']) .
    drupal_render($form['form_build_id']).
    drupal_render($form['submit']);
  return $out;
}

And in page.tpl.php i inserted this code

<?php
        $login_form = get_user_login_form(); 
        ?>
        <?php print $login_form->form_start; ?>
        <div class="name-tag"><?php print $login_form->name; ?></div><div class="pass-tag"><?php print $login_form->pass; ?></div><div class="submit-tag"><?php print $login_form->submit; ?></div>
        <?php print $login_form->form_end;
?>

then i am trying to login using email but its not working. this code is generating html form like as

<form method='post' accept-charset='UTF-8' action='/dru/user/login'>        <div class="name-tag"><div class="form-item" id="edit-name-1-wrapper">
 <input type="text" maxlength="60" name="name" id="edit-name-1" size="10" value="" tabindex="1" title="E-mail" class="form-text required" />
</div>
</div><div class="pass-tag"><div class="form-item" id="edit-pass-1-wrapper">

 <input type="password" name="pass" id="edit-pass-1"  maxlength="128"  size="10"  tabindex="2" title="Password" class="form-text required" />
</div>
</div><div class="submit-tag"><input type="hidden" name="form_id" id="edit-user-login-form" value="user-login-form"  />
<input type="hidden" name="form_build_id" id="form-8d944c2ceca0b8a4141c73564d35b69b" value="form-8d944c2ceca0b8a4141c73564d35b69b"  />
<input type="submit" name="op" id="edit-submit-2" value=""  tabindex="3" class="form-submit" />
</div>
        </form>

here if i am disabling email-registration module & changing ‘title’=>’E-mail’ to ‘title’=>’name’ in attribute tag its working fine for names. whatever css id it is generating it is adding extra text “-1” in html output. i think it is creating problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:44:03+00:00Added an answer on May 24, 2026 at 2:44 am

    Login Toboggan is a pretty widely used and supported module which already provides support to login via email or username, among many other login based features.

    If you’re already aware this exist and still want to write something custom, then I apologize. I’m not sure how to help you going with a theme based approach. Personally I would be using a custom module and either hook_form_alter() to modify the existing user_login form, or writing my own new form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make a custom :confirm message for a rails form that returns data
I am writing a custom session handler in PHP and trying to make the
I was trying to make a custom application form. I've added some control like
I'm trying to make a simple login with JSP, and I have a custom
I'm trying to make custom suggestion to search dialog. I'm using a urimatcher to
I'm trying to make a custom view in Django admin. I'm reading from this
I'm trying to make a custom infowindow. Version = 2. I have added my
I have a custom login-actionfilter where that I'm trying to upgrade to mvc 2
Im trying to make custom icons for my HTC EVO, which is running Cyanogen
I'm trying to make a custom sound play on a status bar notification. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.