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
They look fine...
Hmm.. im not sure what we have missed till now.. can you attach the file which has the login part in here please also any file related to it.
I have attached the file here
the file has the following

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0041)http://www.emeraldfeathers.com/testbb.php -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<FORM action=efforums/member.php method=post>
<META content="MSHTML 6.00.6000.16397" name=GENERATOR></HEAD>
<BODY>Username: <INPUT maxLength=30 size=25 name=username><BR>Password: <INPUT 
type=password size=25 name=password> <INPUT type=hidden value=do_login 
name=action> <INPUT type=hidden value=http://www.yousite.com/ name=url> <INPUT class=submit type=submit value=Login name=submit></FORM><BR></BODY></HTML>

Nothing of the codes that we have previously discussed.
can you save only as .php not .php.htm and try
well when i saved the file it saved as .php.htm but it is really .php. also the code has only this:

<?php

define('IN_MYBB', 1);
chdir('/home/emerald/public_html/forums'); // path to MyBB
require 'global.php';
?>
<HTML>
<?php

if($mybb->user['uid'])
{
  // The user is logged in, say Hi
echo "Hey, {$mybb->user['username']}.<br>
Thanks for logging in.";
}
else
{
  // The user is not logged in, Display the form
echo "<form action='efforums/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://www.yousite.com/' />
<input type='submit' class='submit' name='submit' value='Login' /></form><br>";
}
?>
</HTML> 

try with this
chdir('forums');
instead of
chdir('/home/emerald/public_html/forums');

change this
if($mybb->user['uid'])
to

if($mybb->user['uid'] > 0)
hmm. gosh. I can't see why it isnt working... I mean i tried it on another server with a new installation and everything... Have you tired it with 1.2.3?
Ok this is odd, I have the script allowing me to log in and it returns to back to the main page fine, however it doesn't register me as logged in, and still shows the log in form.

I am actually logged if I go to the forums, so I'm pretty confused about this.
Try using this MrDoom, I have modified it a little bit and it's working for me.

Put before anything:
<?php
chdir('forums'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
?>

Where you want the form:
<?php
if($mybb->user['uid'])
{
// The user is logged in, say Hi
echo "Welcome!";
}
else
{
// The user is not logged in, Display the form
echo "<form action='forums/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='index.php' />
<input type='submit' class='submit' name='submit' value='Login' /></form><br>";
}
?>
 
No difference at all.
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