Unstoppable Domains

PHP problem

Spaceship Spaceship
Watch

benc811

Established Member
Impact
4
I am hacking phpbb and I am getting this error on one of the pages that connects to session.php to find if a user is logged in or not.

The problem however is I am getting this error.
Code:
Warning: Cannot modify header information - headers already sent by (output started at /public_html/forum/thispage.php:3) in /public_html/forum/includes/sessions.php on line 305

Warning: Cannot modify header information - headers already sent by (output started at /public_html/forum/thispage.php:3) in /public_html/forums/includes/sessions.php on line 306

I get this error once but it disappears when the page is refreashed.

Anyone know off the top of there head what the problem might be? What are the headers sent by phpbb?

Thanks in advance, Ben
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
That's because your sending the header information twice, you know, the stuck that goes between the <head></head> tags.

So, what you gotta do is decide which one suites that page better, and going into either one of those two files and delete the part that prints/echoes the header.

Although, I'm not sure why it disapears when you refresh the page...
 
0
•••
sergio965 the php error message regarding headers already sent has absolutely nothing to do with the html head tags. PHP sends header information before it outputs to the browser and if you try and send that information after something has been sent as output then you will get this error UNLESS you have output buffering enabled. Information that would be sent in the header would be for example cookie information or mime types of a page (so the browser knows if it is an image, html document or whatever).

Most likely in a piece of code that only executes when the session is created and not when it already exists.

What is the actual code you are trying to enter and where?
 
0
•••
I figured it was the mime or cookies. Here is the code being used in the page to check if there logged in or not and display content based on that. Everything works it just displays the error and disapears when refreshed.

PHP:
<HTML><HEAD><TITLE>AnnoyTheWorld - TV</TITLE>
<LINK href="http://www.annoytheworld.com/newATW/style.css" type=text/css rel=StyleSheet>
<style type="text/css">
<!--
.style2 {
	color: #ffa500;
	font-weight: bold;
}
body {

	background-color: #1D2025;
}

-->
</style>
</HEAD>
<BODY text=#ffffff>
<?php
    if( isset($_POST['video']) ){
        $video = $_POST['video']; // chosen video
    }

    else{

        $video = "http://www.annoytheworld.com/newATW/ads/video/ad.wmv"; // default video
   }
?>
<?php
$phpbb_root_path = '../';
define ('IN_PHPBB', true);
//check if extension.inc exists to see if everything works
if (!file_exists($phpbb_root_path . 'extension.inc'))
{
    die ('$phpbb_root_path is bad cant find extension.inc');
}
// phpBB related files
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.php');
include_once ($phpbb_root_path . 'includes/bbcode.php');
// Fetch All related files - we do need all these because the portal is a
// huge example
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.php');
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.php');
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/users.php');
// start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// disconnect from the database
phpbb_disconnect();
?>
<TABLE width=750 height="401" border=0 align=center cellPadding=0 cellSpacing=0 borderColor=#8b8b8b>
<TBODY>
<TR>
<TD vAlign=top background="http://www.annoytheworld.com/newATW/images/atwtvplayer.jpg"><div align="center">
  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" background="images/atwtvplayer.jpg">
    <tr>
      <td width="56%" height="399"><div align="center">
          <center>
                    <p>ย </p>
                    <p>ย </p>
                    <table width="395" height="323" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><p align="center">
                            <embed src='<?php echo $video; ?>' width='395' height='310' autostart='true' loop='True' name='RAOCXplayer' type='application/x-mplayer2' showcontrols='1' showstatusbar='1' enablecontextmenu='0' displaysize='0' bgcolor="#1d2126" showtracker='-1' showdisplay='0' videoborder3d='-1' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' border="0"></embed>
                            <font color="ffa500"><b>[</b></font><a href="<?php echo $video; ?>">Download Video</a><font color="ffa500"><b>]</b></font> Welcome back [<?php echo $userdata['username']; ?>]</p></td>
                      </tr>
                    </table>
                  </center>
        </div>
          <p></p>
      <td width="27%">ย </td>
      <td width="17%"><table width="100%" height="402" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="80">ย </td>
          </tr>
          <tr>
            <td height="55"><div align="center">                    <font color="ffa500"><b>VIDEOS</b></font><br>
                    <BR>
                    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                      <select name="video">
                        <?php include('http://www.annoytheworld.com/newATW/videolist.php'); ?>
                      </select>
                      <input type="submit" value="Play">
                    </form>
            </div></td>
          </tr>
          <tr>
            <td width="129" height="55"><div align="center">
            
<div align="center">
<!-- USER logged in-->
<?php if ($userdata) { ?>
<?php if ($userdata['session_logged_in']) { ?>
<font color="ffa500"><b>LIVE FEEDS</b></font><BR>
              <BR>
              <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                      <select name="video">
                        <?php include('http://www.annoytheworld.com/newATW/livefeedlist.php'); ?>
                      </select>
                      <br><input type="submit" value="Play">
                    </form>
<?php }
} ?>
<!-- USER logged in-->

<!-- LOGIN FORM-->
<?php if (!$userdata or !$userdata['session_logged_in']) { ?>
<b>Login to view cams</b><br><br>
<form action="http://www.annoytheworld.com/forums/login.php" method="post" target="_top">
<input type="text" name="username" size="15" maxlength="40" value="Username" /><br /><br>
<input type="text" name="password" size="15" maxlength="25" value="Password" /><br /><br>
<input type="hidden" name="sid" value="<?php echo $userdata['session_id']; ?>" />
<input type="hidden" name="outside" value="1" />
<input type="submit" class="mainoption" name="login" value="Login" />
</form>
<?php } ?>
<!-- LOGIN -->
</div>
                  </div></td>
          </tr>
          <tr>
            <td height="90"><!-- START ADENGAGE.COM CODE -->
              <div align="center">
                <SCRIPT LANGUAGE="JavaScript">
adengage_bg_color='None';
adengage_border_color='None';
adengage_link_color='FF9900';
adengage_desc_color='FFFFFF';
adengage_click_count_color='None';
              </SCRIPT>
                <SCRIPT SRC="http://www.adengage.com/js/281_rect1_adbox.js" LANGUAGE="JavaScript"></SCRIPT>
              </div>
              <!-- END ADENGAGE.COM CODE --></td>
          </tr>
      </table></td>
    </tr>
  </table>
</div></TD>
</TR></TBODY></TABLE></BODY></HTML>
 
0
•••
filth said:
What is the actual code you are trying to enter and where?

Unless he posts both files, it's not going to work as we don't know what exact information he's trying to output twice.
 
0
•••
PHP:
<?php
/***************************************************************************
 *                                sessions.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : [email][email protected][/email]
 *
 *   $Id: sessions.php,v 1.58.2.12 2005/02/27 20:33:01 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

//
// Adds/updates a new session to the database for the given userid.
// Returns the new session ID on success.
//
function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0)
{
	global $db, $board_config;
	global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

	$cookiename = $board_config['cookie_name'];
	$cookiepath = $board_config['cookie_path'];
	$cookiedomain = $board_config['cookie_domain'];
	$cookiesecure = $board_config['cookie_secure'];

	if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
	{
		$session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
		$sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
		$sessionmethod = SESSION_METHOD_COOKIE;
	}
	else
	{
		$sessiondata = array();
		$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
		$sessionmethod = SESSION_METHOD_GET;
	}

	//
	if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) 
	{
		$session_id = '';
	}

	$last_visit = 0;
	$current_time = time();
	$expiry_time = $current_time - $board_config['session_length'];

	//
	// Try and pull the last time stored in a cookie, if it exists
	//
	$sql = "SELECT * 
		FROM " . USERS_TABLE . " 
		WHERE user_id = $user_id";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql);
	}

	$userdata = $db->sql_fetchrow($result);

	if ( $user_id != ANONYMOUS )
	{
		$auto_login_key = $userdata['user_password'];

		if ( $auto_create )
		{
			if ( isset($sessiondata['autologinid']) && $userdata['user_active'] )
			{
				// We have to login automagically
				if( $sessiondata['autologinid'] === $auto_login_key )
				{
					// autologinid matches password
					$login = 1;
					$enable_autologin = 1;
				}
				else
				{
					// No match; don't login, set as anonymous user
					$login = 0; 
					$enable_autologin = 0; 
					$user_id = $userdata['user_id'] = ANONYMOUS;
				}
			}
			else
			{
				// Autologin is not set. Don't login, set as anonymous user
				$login = 0;
				$enable_autologin = 0;
				$user_id = $userdata['user_id'] = ANONYMOUS;
			}
		}
		else
		{
			$login = 1;
		}
	}
	else
	{
		$login = 0;
		$enable_autologin = 0;
	}

	//
	// Initial ban check against user id, IP and email address
	//
	preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);

	$sql = "SELECT ban_ip, ban_userid, ban_email 
		FROM " . BANLIST_TABLE . " 
		WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
			OR ban_userid = $user_id";
	if ( $user_id != ANONYMOUS )
	{
		$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "' 
			OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
	}
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
	}

	if ( $ban_info = $db->sql_fetchrow($result) )
	{
		if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )
		{
			message_die(CRITICAL_MESSAGE, 'You_been_banned');
		}
	}

	//
	// Create or update the session
	//
	$sql = "UPDATE " . SESSIONS_TABLE . "
		SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
		WHERE session_id = '" . $session_id . "' 
			AND session_ip = '$user_ip'";
	if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
	{
		$session_id = md5(uniqid($user_ip));

		$sql = "INSERT INTO " . SESSIONS_TABLE . "
			(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
			VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
		if ( !$db->sql_query($sql) )
		{
			message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);
		}
	}

	if ( $user_id != ANONYMOUS )
	{// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : ( 
		$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; 

		$sql = "UPDATE " . USERS_TABLE . " 
			SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
			WHERE user_id = $user_id";
		if ( !$db->sql_query($sql) )
		{
			message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
		}

		$userdata['user_lastvisit'] = $last_visit;

		$sessiondata['autologinid'] = ( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '';
		$sessiondata['userid'] = $user_id;
	}

	$userdata['session_id'] = $session_id;
	$userdata['session_ip'] = $user_ip;
	$userdata['session_user_id'] = $user_id;
	$userdata['session_logged_in'] = $login;
	$userdata['session_page'] = $page_id;
	$userdata['session_start'] = $current_time;
	$userdata['session_time'] = $current_time;

	setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
	setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);

	$SID = 'sid=' . $session_id;

	return $userdata;
}

//
// Checks for a given user session, tidies session table and updates user
// sessions at each page refresh
//
function session_pagestart($user_ip, $thispage_id)
{
	global $db, $lang, $board_config;
	global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

	$cookiename = $board_config['cookie_name'];
	$cookiepath = $board_config['cookie_path'];
	$cookiedomain = $board_config['cookie_domain'];
	$cookiesecure = $board_config['cookie_secure'];

	$current_time = time();
	unset($userdata);

	if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
	{
		$sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
		$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
		$sessionmethod = SESSION_METHOD_COOKIE;
	}
	else
	{
		$sessiondata = array();
		$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
		$sessionmethod = SESSION_METHOD_GET;
	}

	// 
	if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
	{
		$session_id = '';
	}

	//
	// Does a session exist?
	//
	if ( !empty($session_id) )
	{
		//
		// session_id exists so go ahead and attempt to grab all
		// data in preparation
		//
		$sql = "SELECT u.*, s.*
			FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
			WHERE s.session_id = '$session_id'
				AND u.user_id = s.session_user_id";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
		}

		$userdata = $db->sql_fetchrow($result);

		//
		// Did the session exist in the DB?
		//
		if ( isset($userdata['user_id']) )
		{
			//
			// Do not check IP assuming equivalence, if IPv4 we'll check only first 24
			// bits ... I've been told (by vHiker) this should alleviate problems with 
			// load balanced et al proxies while retaining some reliance on IP security.
			//
			$ip_check_s = substr($userdata['session_ip'], 0, 6);
			$ip_check_u = substr($user_ip, 0, 6);

			if ($ip_check_s == $ip_check_u)
			{
				$SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';

				//
				// Only update session DB a minute or so after last update
				//
				if ( $current_time - $userdata['session_time'] > 60 )
				{
					$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id 
						WHERE session_id = '" . $userdata['session_id'] . "'";
					if ( !$db->sql_query($sql) )
					{
						message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
					}

					if ( $userdata['user_id'] != ANONYMOUS )
					{
						$sql = "UPDATE " . USERS_TABLE . " 
							SET user_session_time = $current_time, user_session_page = $thispage_id 
							WHERE user_id = " . $userdata['user_id'];
						if ( !$db->sql_query($sql) )
						{
							message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
						}
					}

					//
					// Delete expired sessions
					//
					$expiry_time = $current_time - $board_config['session_length'];
					$sql = "DELETE FROM " . SESSIONS_TABLE . " 
						WHERE session_time < $expiry_time 
							AND session_id <> '$session_id'";
					if ( !$db->sql_query($sql) )
					{
						message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
					}

					setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
					setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
				}

				return $userdata;
			}
		}
	}

	//
	// If we reach here then no (valid) session exists. So we'll create a new one,
	// using the cookie user_id if available to pull basic user prefs.
	//
	$user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;

	if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
	{
		message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);
	}

	return $userdata;

}

//
// session_end closes out a session
// deleting the corresponding entry
// in the sessions table
//
function session_end($session_id, $user_id)
{
	global $db, $lang, $board_config;
	global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

	$cookiename = $board_config['cookie_name'];
	$cookiepath = $board_config['cookie_path'];
	$cookiedomain = $board_config['cookie_domain'];
	$cookiesecure = $board_config['cookie_secure'];

	$current_time = time();

	//
	// Pull cookiedata or grab the URI propagated sid
	//
	if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) )
	{
		$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
		$sessionmethod = SESSION_METHOD_COOKIE;
	}
	else
	{
		$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
		$sessionmethod = SESSION_METHOD_GET;
	}

	if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
	{
		return;
	}
	
	//
	// Delete existing session
	//
	$sql = "DELETE FROM " . SESSIONS_TABLE . " 
		WHERE session_id = '$session_id' 
			AND session_user_id = $user_id";
	if ( !$db->sql_query($sql) )
	{
		message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql);
	}

	setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
	setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);

	return true;
}

//
// Append $SID to a url. Borrowed from phplib and modified. This is an
// extra routine utilised by the session code above and acts as a wrapper
// around every single URL and form action. If you replace the session
// code you must include this routine, even if it's empty.
//
function append_sid($url, $non_html_amp = false)
{
	global $SID;

	if ( !empty($SID) && !preg_match('#sid=#', $url) )
	{
		$url .= ( ( strpos($url, '?') != false ) ?  ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
	}

	return $url;
}

?>

sorry forgot heres sessions.php
 
0
•••
which exact lines did you add just before the problem started.

sergio965 you do not seem to understand what the problem is HE IS NOT TRYING TO OUTPUT THE SAME THING TWICE.

He is trying to output headers after the headers have been sent and output has started.
 
0
•••
I made the script to check if logged in and the page that displays the videos both worked fine then I put them together and got the problem.

PHP:
<?php
$phpbb_root_path = '../';
define ('IN_PHPBB', true);
//check if extension.inc exists to see if everything works
if (!file_exists($phpbb_root_path . 'extension.inc'))
{
    die ('$phpbb_root_path is bad cant find extension.inc');
}
// phpBB related files
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.php');
include_once ($phpbb_root_path . 'includes/bbcode.php');
// Fetch All related files - we do need all these because the portal is a
// huge example
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.php');
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.php');
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/users.php');
// start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// disconnect from the database
phpbb_disconnect();
?>

PHP:
<!-- USER logged in-->
<?php if ($userdata) { ?>
<?php if ($userdata['session_logged_in']) { ?>
<font color="ffa500"><b>LIVE FEEDS</b></font><BR>
              <BR>
              <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                      <select name="video">
                        <?php include('http://www.annoytheworld.com/newATW/livefeedlist.php'); ?>
                      </select>
                      <br><input type="submit" value="Play">
                    </form>
<?php }
} ?>
<!-- USER logged in-->

<!-- LOGIN FORM-->
<?php if (!$userdata or !$userdata['session_logged_in']) { ?>
<b>Login to view cams</b><br><br>
<form action="http://www.annoytheworld.com/forums/login.php" method="post" target="_top">
<input type="text" name="username" size="15" maxlength="40" value="Username" /><br /><br>
<input type="text" name="password" size="15" maxlength="25" value="Password" /><br /><br>
<input type="hidden" name="sid" value="<?php echo $userdata['session_id']; ?>" />
<input type="hidden" name="outside" value="1" />
<input type="submit" class="mainoption" name="login" value="Login" />
</form>
<?php } ?>
<!-- LOGIN -->

Those are the two parts that check if the user is logged in and base the page around that.
 
0
•••
ok try moving the following code:-

PHP:
<HTML><HEAD><TITLE>AnnoyTheWorld - TV</TITLE>
<LINK href="http://www.annoytheworld.com/newATW/style.css" type=text/css rel=StyleSheet>
<style type="text/css">
<!--
.style2 {
    color: #ffa500;
    font-weight: bold;
}
body {

    background-color: #1D2025;
}

-->
</style>
</HEAD>
<BODY text=#ffffff>
<?php
    if( isset($_POST['video']) ){
        $video = $_POST['video']; // chosen video
    }

    else{

        $video = "http://www.annoytheworld.com/newATW/ads/video/ad.wmv"; // default video
   }
?>

to AFTER

PHP:
phpbb_disconnect();
?>

That stuff is being processed before initializing your session.
 
0
•••
Wow you my friend are impressive. Thanks a triillion, and by the way why is that a problem for future refference?
 
0
•••
You are executing a PHP function such as (header,session,cookie,mail) after you have outputted text or something else to the browser. All header functions need to be either executed first or must be in a ob_start,ob_end_flush command.

iNod.
 
0
•••
Oh cool must admite didnt know that thanks.
 
0
•••
that is no problem at all benc811.

as iNod states any information that is meant to enclosed in header information MUST be sent before any output to the browser (even a blank space will cause a problem). Such things are sessions, cookies and mime types amongst other things. Not sure why iNod states mail however as that isn't anything to do with outputting to the browser.
 
0
•••
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back