Hey
I’m going to briefly go over some code that will allow you to place a login field any where on your drupal website.
First we have to write the condition that tells drupal to check and see if the user is logged in.
<?php global $user; ?>
<?php if ($user->uid) : ?>
(place code here to let the user know that they are logged in)
<?php else : ?>
Now you’ll notice there is an open “else” that we have to fill. Well after else you can put:
<form action=”/user” method=”post” id=”user-login-form2″>
<span style=”font-size:11px; line-height:10px; height: 10px; margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-top: 0pt; padding-right: 0pt; padding-bottom: 0pt; padding-left: 0pt; text-align:left;”> Username: </span>
<input style=”font-size : 11px;” type=”text” maxlength=”60″ name=”name” id=”edit-name” size=”15″ value=”" tabindex=”1″ class=”form-text required” />
<br>
<span style=”font-size:11px; line-height:10px; height: 10px; margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-top: 0pt; padding-right: 0pt; padding-bottom: 0pt; padding-left: 0pt;”> Password: </span>
<input style=”font-size : 11px;” type=”password” name=”pass” id=”edit-pass” size=”15″ tabindex=”2″ class=”form-text required” />
<br>
<input type=”submit” name=”op” id=”edit-submit” value=”Log in” tabindex=”3″ 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”> Forgot Pass?</a>
<input type=”hidden” name=”form_id” id=”edit-user-login” value=”user_login” /></form>
<?php endif; ?>
Now you can remove or modify the inline styles that I have in there. I had them there when I was playing around with the font size and spacing on thr4shmetal.com. There’s not much else to know. I tested this on drupal 5.x and 6.x Enjoy.







