Losin session on added page
Posted: Thu Feb 12, 2004 10:01 am
win xp pro
apache
phpbb2 plus 1.3
I have a website which is linked through ezportal
when i log on everything is fine i can access all the ezportal links i.e. staff site, memberslist etc. when i click the link to the index page of my web site everything still seems fine however when i link to the next page in my site im logged out so somewhere i'm losing my session i have included
at the top of each page
any ideas i'll put the code for my site pages below
the link from ezportal goes to this page
the link from the above page which is in a custom header goes to this page
and its this last page i seem to be losing the session
whats going on
all my pages are in the phpbb2 root
apache
phpbb2 plus 1.3
I have a website which is linked through ezportal
when i log on everything is fine i can access all the ezportal links i.e. staff site, memberslist etc. when i click the link to the index page of my web site everything still seems fine however when i link to the next page in my site im logged out so somewhere i'm losing my session i have included
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
?>any ideas i'll put the code for my site pages below
the link from ezportal goes to this page
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$page_title = "inf_index.php";
if ($userdata['session_logged_in'])
{
//echo "Welcome ";
//echo $userdata[username];
//echo " you r logged in.";
include("inf_music_header.tpl");
include("inf_music_navbar.tpl");
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
echo "<tr>";
echo "<td width='100%' background='./templates/fisubsilversh/images/cellpic3.gif'><div align='center' class='style2 style3'><strong>
UK Number 1 Singles</strong></div></td>";
echo "</tr>";
echo "</table>";
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
// set up field bar
echo "<td width='100%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>display some text to tell users about this part of the site and maybe add some flash animation and music
hggjhghjgjgjgjgjjgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</div></td>";
// Finally we close off the table
echo "</table>";
include("inf_music_footer.tpl");
}
else
{
echo "You r not logged in";
}
?>Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$page_title = "inf_1_singles.php";
if ($userdata['session_logged_in'])
{
//echo "Welcome ";
//echo $userdata[username];
//echo " you r logged in.";
include("inf_music_header.tpl");
$navbar = (int)$_GET['navbar'];
if(!isset($_GET['navbar']))
{
//$navbar = 5;
}
if ($navbar == 5)
{
include("inf_music_navbar_1950s.tpl");
}
elseif ($navbar == 6)
{
include("inf_music_navbar_1960s.tpl");
}
elseif ($navbar == 7)
{
include("inf_music_navbar_1970s.tpl");
}
$location = "localhost";
$username = "xxxx";
$password = "xxxx";
$database = "MYMUSIC";
$conn = mysql_connect("$location","$username","$password");
$year = (int)$_GET['year'];
if(!isset($_GET['year']))
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$query = "SELECT * FROM numberones WHERE `year` = '$year'";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
echo "<tr>";
echo "<td width='100%' background='./templates/fisubsilversh/images/cellpic3.gif'><div align='center' class='style2 style3'><strong>
Number 1 Singles from $year </strong></div></td>";
echo "</tr>";
echo "</table>";
echo "<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#006699' align='center'>";
echo "<td width='13%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Date</div></td>";
echo "<td width='33%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Artist</div></td>";
echo "<td width='39%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Title</div></td>";
echo "<td width='6%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Wks</div></td>";
echo "<td width='9%' background='./templates/fisubsilversh/images/cellpic1.gif'><div align='center' class='style1'>Download</div></td>";
while($row = mysql_fetch_array($result))
{
echo "<tr><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[year]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[artist]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[title]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'>$row[weeksatone]</div></td></tc>";
echo "<tc><td background='./templates/fisubsilversh/images/cellpic_nav.gif'><div align='center'><a href="$row[dllink]"><img src='./templates/fisubsilversh/images/icon_download.gif'></a></div></td></tr>";
}
echo "</table>";
include("inf_music_footer.tpl");
// Release the Result Set
mysql_free_result($result);
// Close the connection
mysql_close($conn);
}
else
{
echo "You r not logged in";
}
?>whats going on
all my pages are in the phpbb2 root