Knowledge Base

Forum breaking out of frames after login
Article ID: 11
Written By: Anon
Written On: Mon Apr 23, 2007 4:03 am
Description: This is a simple change to stop the forum popping out of a framed site after logging in.
link to this article on phpbb.com: Select All
[kb=forum-breaking-out-of-frames-after-login]Forum breaking out of frames after login[/kb]
link to this article on your own board: Select All
[url=http://www.phpbb.com/kb/article/forum-breaking-out-of-frames-after-login/]Knowledge Base - Forum breaking out of frames after login[/url]

Issue At Hand
  • A lot of people place their phpBB install inside a frame. However this can cause problems when logging on to the forum, with the actual board loading outside of the frame once a user tries to log on.
Some Reasons For Using Frames
  • You may be using frames more than you know. Some sites use them as they can preserve menus etc., so they are site wide. Also, they can be used as floating headers.
  • A very common reason is free domains. Services such as No-IP, .TK and uni.cc all offer free domain names, and all you have to do is place your forums address in and poof! The domain now points to your forums.
  • Frames are most commonly used to include the forum into a web sites layout easily and without too much site editing.
The Fix
  • Open

    phpBB2/templates/xxx/login_body.tpl

    Note: xxx is a variable. On the default installation, it will be subSilver, but if you have installed another template( IE You don't use subSilver) then you will have to apply this fix to login_body.tpl for the other templates too
  • Find
    Code: Select all
    <form action="{S_LOGIN_ACTION}" method="post" target="_top">
  • Replace with
    Code: Select all
    <form action="{S_LOGIN_ACTION}" method="post" target="_self">
  • Save and upload
Important Note*
  • As with all MODs/file edits, backup before hand, in case something goes wrong. It's generally a good idea to keep regular SQL and file backups!

If you find any mistakes in this article, or think it is missing some useful information please pm me via the phpBB.com forum. If you need help with this or other styles questions, the Styles fora will be able to help