سؤال

I have an HTML page displaying my phpBB3 forum through an iframe like using the following:

      <iframe name="inlineframe" src="http://www.website.net/forums/index.php" frameborder="0" scrolling="auto" width="100%" height="1500" marginwidth="5" marginheight="5" ></iframe>.

I am doing this in order to display an HTML coded menu bar on top of the forum.

On another HTML page (the home page), I have a container with input fields allowing you to log in directly to the forums via the following code:

      <form action="http://www.website.net/login.php?mode=login" method="post">
        <label for="username">Username</label><input type="text" name="username" required>
        <label for="password">Password</label><input type="password" name="password" required>
        <input type="submit" name="login" value="Login" class="loginbtn"/><a href="http://www.website.net/register.php">Register</a>
      </form>

Therefore, if the user types their login info into the box and hits submit, they are taken directly from the home page into the forums and automatically sign in.

It works fine when I link the submit button directly to the phpBB forums (does not have the menu bar) but not when it is embedded (with the menu bar).

If used with the embedded PHP link (www.website.net/register.php), the browser simply takes me to the login page without inputting any of the fields submitted.

هل كانت مفيدة؟

المحلول

The best thing to do is modify the header template of your forum's theme and add the menu bar, for example: http://openfantasy.org/forum/

If you want to avoid doing that for whatever reason, I suggest you should add a redirect in phpBB to the page you want post-login.

Look at lines 76-81 in root\ucp.php (phpBB 3.0.11)

if ($user->data['is_registered'])
{
    redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}

login_box(request_var('redirect', "index.$phpEx"));

change that to the URL of the page with the IFrame, and you should be good.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top