integrate phpbb without frame.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ANYang
Forum Newbie
Posts: 5
Joined: Fri May 20, 2005 12:42 am

integrate phpbb without frame.

Post by ANYang »

I have a page that loads phpbb in a frame with this code:

Code: Select all

$forum_link="phpBB2/index.php";
if($VAR[4]){
    $result = mysql_query("SELECT username, user_password FROM phpbb_users WHERE username='".$VAR[4]."'");
    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
        {
        $forum_nick=$row['username'];
        break;
        }
    $result = mysql_query("SELECT password FROM user WHERE user='".$VAR[4]."'") or die(mysql_error());
        while($row = mysql_fetch_array($result, MYSQL_ASSOC))
            {
            $forum_pass=$row['password'];
            break;
        }
 $forum_link="phpBB2/login.php?login=yes&username=".$forum_nick."&password=".$forum_pass;

    }

$DATA="<IFRAME SRC=\"".$forum_link."\" TITLE=\"The MYSITE.com Forum\" width=100% HEIGHT=1000 FRAMEBORDER=0>";
in phpbb's login.php I've added

Code: Select all

if( ( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) ) && (!$userdata['session_logged_in'] || isset($HTTP_POST_VARS['admin'])) )
    {
        $username = isset($HTTP_GET_VARS['username']) ? phpbb_clean_username($HTTP_GET_VARS['username']) : '';
        $password = isset($HTTP_GET_VARS['password']) ? $HTTP_GET_VARS['password'] : '';
       
        if(empty($username)||empty($password))
            {
        /*Moded this section to allow primarly the vars to be passed by the GET instead of the POST
        */
        $username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
        $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';
            }


This will log in the user to phpbb if the user have already logged in to the main site. What I'm trying to figure out is how to get rid of the frame page that loads phpbb. I want the user to go directly/logged in to phpbb's index.php page without the frame page.

Can someone help me with this?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you would need to do somethign client side to step them out of the frame.

something like this might work:

untested:

Code: Select all

<body onLoad="location=document.getElementById('myIframe').src">
I've done something similar but it's been a long time...
Post Reply