Hey guys, I need to put a box in my homepage where you can login or register with vbulletin. I found this code and works very well.
PHP Code:
<?
if (isset($_COOKIE["bbuserid"])) {
print("<span class='welcome'><br><br><center>Welcome back, $username! <br><br><a href=\"http://www.salespractice.com/forums/\">Visit the Forums</a> </center>");
} else {
?>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
<script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script>
<table cellpadding="1" cellspacing="3" border="0">
<tr>
<td class="login">User Name</td>
<td><input type='text' class='button' name='vb_login_username' id='navbar_username' size='10' accesskey='u' tabindex='1' value='' /></td>
<td class="smallfont" colspan="2" nowrap="nowrap"><input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='login'>Remember Me</span></td></tr>
<tr><td class="login">Password</td>
<td><input type='password' class='button' name='vb_login_password' size='13' accesskey='p' tabindex='2' /></td>
<td><input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
<span class="login"> <a href="http://www.salespractice.com/forums/register.php">Register</a></span></td></tr></table>
<input type='hidden' name='do' value='login' />
<input type='hidden' name='forceredirect' value='0' />
<input type='hidden' name='vb_login_md5password' />
</form>
<?
}
?>
But after the login he sent me to this page: domain.com/?
If I get back to the home I see I am logged in, I can't see my username tho, but it says Welcome Back and the link to the forum.
How can I fix these troubles? Do you know another code?
P.s I also put my domain cookies in the vbulletin to .domain.com