Session Problem

Discussion in 'HTML & Website Design' started by X.Homer.X, Oct 25, 2007.

  1. #1
    Okay, so i have the phpBB3 user system integration "script" on my site, (i followed the tutorial at www.techtuts.com)

    and i can let users sign in, but they wont remain signed in. its kind of wierd, its like the session wont stay saved.

    heres my top.php file (included in every page)

    <?php
    session_start();
    ob_start();
    include('config.php'); //Include our config...
    if($user->data['user_id'] != ANONYMOUS) //If the user isnt a guest
    {
    $login = 'Welcome '.$user->data['username'].'!<br><br> <a href="/forum/ucp.php?i=pm&folder=inbox&sid='.$user->session_id.'">Inbox ('.
    $user->data['user_unread_privmsg'].')</a> | <a href="'.append_sid($phpbb_root_path .'ucp.php?mode=logout&sid='.$user->session_id).'">Logout</a>';
    }
    else
    {
    $login = "You are not logged in!<br><br><a href=login.php>Log in here</a>";
    }
    ?>
    <head>
    <title>AbsoluteHabbo Under Construction</title>
    <link href='/includes/styles/style.css' rel='stylesheet' type='text/css' />
    
    </head>
    
    
    <body background="includes/styles/images/3.gif">
    	
    <div id="sitecontainer" align="center">
    	
    			<div id="header"></div>			
    			<div id="middle">
    		  
    <!-- Page container -->
    				<div id="container">
    <!-- ///////////////////// -->
    <!-- Content box --><br>
    				<div id="leftcontainer">
    <!-- Navigation box -->
    				  <div id="navigation">
    		  <?php include("includes/nav.php"); ?>
    				  <div id="spacer" style="padding-top: 10px;"></div>
    				  <!-- Radio player box -->
    				  <?php include("includes/radio_box.php"); ?>
    				  <div id="spacer" style="padding-top: 10px;"></div>
    				  <!-- Main box -->
    				  <?php include("includes/main_box.php"); ?>
    				</div>
    				<div id="rightcontainer">
    				
    						<div id="content_top">
    
    Code (markup):
    please help? xD
     
    X.Homer.X, Oct 25, 2007 IP
  2. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    moda, you can delete this thread, because i did not notice ther was a seperate PHP forum. Sorry for the inconvenience. BTW, of all the website building/designing sites ive been on, this is the most friendly, and quick replying one ive seen.

    Keep up the good work :)
     
    X.Homer.X, Oct 26, 2007 IP
  3. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Hope you find your answer. Sorry i'm not the best with php.

    Just wondering, why don't you have the php in a seperate document and then include it? Would be easier to maintain. Or is that what you are doing? Just showing that for convenience sake?
     
    twistedspikes, Oct 26, 2007 IP
  4. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    the php is in an included file the name of that file is top.php and index.php includes top.php, content.php and bottom.php.

    Thanks for the suggestion though :)
     
    X.Homer.X, Oct 26, 2007 IP
  5. grikis

    grikis Banned

    Messages:
    333
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you cant display any text,images before saving data into sessions!
     
    grikis, Oct 26, 2007 IP