2019-01-19, 11:24 AM
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?
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?
<?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?