I'm not sure on this one but you may try
index.3.html
Find

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<? 
include '../includes/header.php';
?>

Replace with

<? 
include '../includes/header.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

There is something in the software you using that may want to do a redirect or is tring to send new header information

In login3.php
the other thing i noticed is the path to includes directory is different in the same file. It maybe dependent on realitive path of file verses relative path of included file?
i.e.

 require_once( '../includes/PHPBB_login2.php'); 

and

 header("Location: ". "./includes/header.php");

Also it may help if you could tell me what the file is that your callling in the browser that generates the warnings. i.e. are you browsing directly to login2.php or are you browsing to index3.html and get the warnings on that page?

    I had the same problem and not sure if this will help but I had a space (white space?) at the ends of my code. I went through every line to check and delete spaces and everything was fine after that.

      Hi there,

      Thanks for the reply..

      I actually had the header file commented out in login3.php
      Corrected the path and made no difference..

      Also swapped the Doctype line as you said and still getting the same :/

        Removed all whitespace too and same problem..

          No problem on the index page, error only displays on login3.php
          once its called by the form on the index page..

            Just a day or so ago another user was having similar problems and he was using the Dreamweaver as his editor but on top of that he was working on a file that had been edited with another editor. There are sometimes characters placed into a document that you will not see, so as an experiment open your documents with notepad and be absolutely sure that there are no characters in any of the documents anything before the <? in any of these files might not be seen in DW or some other WYSIWYGs but will show up in notepad.

              Just another observation in login3.php
              which is used to log the user in it seems to direct them to your header.php file, normally don't you want to direct the user to the front end of your site or some other user interface page

              header("Location: ". "../includes/header.php"); 

              Your main user page calls login3.php

              <form action="login3.php" method="POST">

              This should set the cookies and then direct the user to the page you want him/her to go to with the

              header("Location: ". "../includes/header.php"); 

              It maybe that the headers that are sent in index.3.html and the fact that you are trying to redirect the user to the same header file after they login in login3.php with

              header("Location: ". "../includes/header.php"); 

              Maybe login3.php needs to be something like

              header("Location: ". "PATHTOYOURUSERPAGE/INDEX.PHP"); 

              just a thought to try???

                Hi all,

                Finally got this sorted! Thanks to everyone who replied.

                I had to remove every bit of whitespace from all three files..

                For those who are interested I have posted the (working) code below..

                Thanks again..

                index3.php

                <? 
                include '../includes/header.php';
                ?>
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                <html>
                <table border="0" cellspacing="5" cellpadding="5">
                
                <tr>
                <td class="left" width="114" height="22" align="left" valign="top"><? include '../includes/menu.php'; ?></p></td>
                <td class="centrearea" width="598" align="left" valign="top">
                
                <div id='middle'>
                
                <p>Please login using your BlastBeat Login below:</p></h3>
                <form action="login3.php" method="POST">
                <table align="center" border="0">
                <tr>
                <th><div align="left">
                Username:
                </div></th>
                <th>
                <div align="left">
                <input name="username" type="text" id="username">      
                <br> </div></th> </tr> <tr> <th> <p align="left">Password<em> (case sensitive)</em>:</p> </th> <th> <div align="left"> <input name="user_password" type="password" id="user_password"> </div></th> </tr> <tr> <th colspan="2" align="right"> <div align="left"> <input type="submit" value="Submit"> </div> </form> <p>&nbsp;</p> <p>&nbsp;</p> </body> </html>

                login3.php

                <?php
                require_once( '../includes/PHPBB_login2.php');
                include '../includes/connect_blast_phpbb.php';
                
                session_start();
                
                $username = $_POST['username'];
                $user_password = $_POST['user_password'];
                $user_password = md5($user_password); 
                
                $user = new User();
                $user_id = $user->login( $username, $user_password ); 
                
                if ($user_id !== -1)
                {
                	// Then login the user to the forum
                	$phpbb = new PHPBB_Login();
                
                $phpbb->login( $user_id );
                
                //echo "User should be logged in";
                header("Location: " . "../index.php");
                }
                
                else
                {
                
                echo "Login Failed";
                }
                ?>
                

                PHPBB_login2.php

                <?php 
                // Define Your User class
                // User has a method called login
                
                class User 
                { 
                	function login($username,$user_password) 
                	{
                
                	// Authenticate the user
                	$sql  = ("SELECT * FROM phpbb_users WHERE username='$username' AND user_password='$user_password'");
                	$result = mysql_query($sql);
                
                	$login_check = mysql_num_rows($result);
                	$contact = mysql_fetch_object ( $result );
                
                	// if user found
                	if($login_check > 0) 
                	{
                		$user_id = $contact -> user_id;
                		return $user_id;
                	}
                
                	else 
                	{
                		return -1;
                	}
                
                }
                }
                
                class PHPBB_Login
                {
                
                function PHPBB_Login(){}
                
                function login( $phpbb_user_id )
                {
                	define('IN_PHPBB',true);
                	//You may need to change the following line to reflect
                	// your phpBB installation.
                	$phpbb_root_path = "../forum/";
                	global $db, $board_config;
                	global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
                	// Setup the phpbb environment and then
                	// run through the phpbb login process
                	require_once( $phpbb_root_path . "config.php" );
                	require_once( $phpbb_root_path . "extension.inc" );
                	require_once( $phpbb_root_path . "common.php" );
                	return session_begin( $phpbb_user_id, $user_ip, PAGE_INDEX, FALSE, TRUE );
                }
                
                function logout( $session_id, $phpbb_user_id )
                {
                	define('IN_PHPBB',true);
                	// You may need to change the following line to reflect
                	// your phpBB installation.
                	$phpbb_root_path = "../forum/";
                	global $db, $lang, $board_config;
                	global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
                	// Setup the phpbb environment and then
                	// run through the phpbb login process
                	// You may need to change the following line to reflect
                	// your phpBB installation.
                	require_once( $phpbb_root_path . "config.php" );
                	require_once( $phpbb_root_path . "extension.inc" );
                	require_once( $phpbb_root_path . "common.php" );
                	session_end( $session_id, $phpbb_user_id );
                	// session_end doesn't seem to get rid of these cookies,
                	// so we'll do it here just in to make certain.
                	setcookie( $board_config[ "cookie_name" ] . "_sid", "", time() - 3600, " " );
                	setcookie( $board_config[ "cookie_name" ] . "_mysql", "", time() - 3600, " " );
                }
                }
                ?>
                
                  7 months later

                  Hi, i am also trying to implement this but get the errors from the session_start. was any further modification made to this ?

                    I haven't a clue why PHPBB has not stoped using sessions, there really is no reason for using them except to BLOCK search engine from indexing your forum. A cookie is just fine for security and there is no reason to add sessions on top of it.

                    find the mod in PHP Mod forum that allows you to kill, distroy and delete any and all user sessions

                    CB154 wrote:

                    Hi, i am also trying to implement this but get the errors from the session_start. was any further modification made to this ?

                      so the code above uses the session_start() method. did you not implement this way ?

                        Write a Reply...