MyBB Community Forums

Full Version: Login form doesn't seem to work..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I am currently trying to make a clan website, I know with MyBB, you can integrate the login system, so you can login on the website homepage, ect.

Now, I made this header on my site http://www.hoststripe.com/stealthstormers/forum

Now, I am trying to get the login form at the top right of the page, it looks fine, but it just won't login..
I got this from a tutorial, but edited it a bit to work with my template.. If you could help by telling me how to fix this please, that would be great!

This part is at the very top
<?php
chdir('forums'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
?>


This part is where the login form is
<fieldset class="quick-login">
<legend>Quick Login</legend>
<?php

if($mybb->user['uid'])
{
echo "Hi, $mybbuser[username].";
}
else
{
echo "<form action='forum/member.php' method='post'>
<label for="username">Username</label> <input type="text" id="username" name="username" value="username" class="loginbox" title="Username" />
<label for="password">Password</label> <input type="password" id="password" name="password" value="password" class="loginbox" title="Password" />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='index.php' />
<input type="submit" value="Login" class="submit" title="Login" />
<span><a href="../forum/member.php?action=register" title="Register">Register</a> - <a href="../forum/member.php?action=lostpw" title="Forgot Password?">Forgot Password?</a></span>
</fieldset>
}
?></div>
Why are you adding
<fieldset class="quick-login">
<legend>Quick Login</legend>
above the <?php tag ?

Instead, try the following;

<?php

if($mybb->user['uid'])
{
echo "Hi, $mybbuser[username].";
}
else
{
echo "<form action='member.php' method='post'>
<label for="username">Username</label> <input type="text" id="username" name="username" value="username" class="loginbox" title="Username" />
<label for="password">Password</label> <input type="password" id="password" name="password" value="password" class="loginbox" title="Password" />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='index.php' />
<input type="submit" value="Login" class="submit" title="Login" />
<span><a href="../forum/member.php?action=register" title="Register">Register</a> - <a href="../forum/member.php?action=lostpw" title="Forgot Password?">Forgot Password?</a></span>
</fieldset>
}
?>
When I did, the whole login form moved under the header, the submit box disappeared, and the whole header got messed up..
Bump..?
(2010-12-17, 04:21 PM)Tigierz Wrote: [ -> ]When I did, the whole login form moved under the header, the submit box disappeared, and the whole header got messed up..

What code you are going to add and in where / which file ?
Well at the top of the header.
I plan to put the login in all parts of the site, I am starting with the forums, on the header template.