Ok, So I made a custom login block for my drupal install and I type in information in and all, submit and it takes me to the login page. I type it in again and I finally login. I am not sure why this is not working, I found this code on this site and modified it slightly (can't remember where.)

global $user;
if ($user->uid) :
print l("logout","logout");
else :

print drupal_get_destination() " method="post" id="user-login">
Username:





Password:








Create account
Lost password

endif;

I am running Drupal 6. Also if you could tell me where I can locate the code for the pre-installed blocks so I can use as reference that'd be great.

Comments

MrTeenie’s picture

Sorry I didn't use the code tags, here is the code.

<?php global $user; ?>
<?php if ($user->uid) : ?>
<?php print l("logout","logout"); ?>
<?php else : ?>
<form action="/drupal/?q=user&amp;<?php print drupal_get_destination() ?>" method="post" id="user-login">
Username:
<br>
<input type="text" maxlength="60" name="edit[name]" id="edit-name" size="15" value="" class="form-text required" />
<br>
Password:
<br>
<input type="password" maxlength="" name="edit[pass]" id="edit-pass" size="15" class="form-text required" />
<br>
<input type="submit" name="op" value="Login" class="form-submit" />
<br>
<a href="/drupal/?q=user/register" title="Create account">Create account</a>
<a href="/drupal/?q=user/password" title="Retrieve lost password">Lost password</a>
<input type="hidden" name="edit[form_id]" id="edit-user-login" value="user_login" />
</form>
<?php endif; ?>
VM’s picture

code for the login block would be in the user.module I believe.

MrTeenie’s picture

I looked, yet can't figure out whats wrong with the form still... any ideas?

eriknewby’s picture

Did you ever figure this one out?
I am having that exact same issue.

Thanks!