MyBB Community Forums

Full Version: Can't get login interigation to work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a problem. I've tried understanding following tutorial: https://community.mybb.com/thread-60422.html but I can't get it to work. Here's what I have done can someone please tell me what's wrong?

<?php
chdir("forums/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
chdir("../");


if($mybb->user['uid'])
{
	// If the user if logged in, display a welcoming message.
	echo "Welcome back ".$mybb->user['username']."!<br />";
	echo "Thanks for logging in.";
}
else
{
	// If the user is not logged in, display the login form.
	echo "<form action='forums/member.php' method='post'>";
	echo "<input type='hidden' name='action' value='do_login' />";
	echo "<input type='hidden' name='url' value='../index.php' />";
	echo "Username: <input type='text' name='username' maxlength='30' /><br />";
	echo "Password: <input type='password' name='password' /><br />";
	echo "<input type='submit' name='submit' value='Login' />";
	echo "</form>";
}

?>



The code does not show any kind of login form even though I am NOT logged in and instead just redirecting me to the /forums/

I want the login form to show but why isn't?
login form should appear depending on the file you have used for the code.

do you have any redirect code in .htaccess file ?

do you have custom coded home site or is it a CMS like wordpress , joomla ... ?