MyBB Community Forums

Full Version: Integrating MyBB into your website. (Login Form)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<?php
chdir('forum'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
?>
<html>
<head>
<title>?Resource script?</title>
</head>
<body>
<?php



if($mybb->user['uid'] > 0)
{

echo "Hey, $mybbuser[username].<br>
Thanks for logging in.";
}
else
{

echo "<form action='forum/member.php' method='post'>
Username: <input type='text' name='username' size='25' maxlength='30' /><br />
Password: <input type='password' name='password' size='25' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='http://mybbtest.host22.com/Resources.php' />
<input type='submit' class='submit' name='submit' value='Login' /></form><br>";
}
?>
</body>
</html>
this is my code but when i log in i log in on the forum but i go back to the same page please help!
I tried using this adding it to my homepage, and the login works, but you don't stay logged in on the homepage.

Using MyBB 1.4, any idea how to fix it?

EDIT: ok, cookies working, you login ;D
but when you login, all it says is:
Hey,
; Thanks for logging in.

and when you aren't logged in it just has the login box, no 'welcome guest'

Also, how can i change it so if you're logged in it'll show:

Avatar, Username,rank, Posts, rep, new posts since last visit and notifications
Is there a code I can add that makes something appear at the top of your page that says "Hey, Ooka.", and display "Hey Guest" if they don't have a username?
Hi Im using a PHP Include, my whole side bar is in a different file and I use <? php include('file'); ?> to put it there.

The login is in the PHP Include file and I need to know how to make it work.
Pretty good tutorial, but when i log in, i don't see username, i've set path right to forum, still doesen't work.
I have a problem, it doesn't work! I log in correctly, but $mybb->user('uid') var return 0.
I use MyBB 1.4.4 and 1.4.9.

Please, help me!
it's your cookie settings.
they must point to your main domain.
Sorry but I don't understand. What I must to do to change the Cookie settings?
what are your cookie settings now and what is your website url
Cookie Domain: .tecnozoom.webcindario.com
Cookie Prefix:
Cookie Path: /foro/

Those are all I found.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48