rallokkcaz Posted April 23, 2007 Share Posted April 23, 2007 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/pokebash/public_html/getmetola/default.html:6) in /home/pokebash/public_html/getmetola/index.php on line 4 this is the error i get on this page http://www.getmetola.com when i try to include the login form does anyone know exactly what that means Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 23, 2007 Author Share Posted April 23, 2007 woah!! something is way wrong on my site hold on a sec Quote Link to comment Share on other sites More sharing options...
clown[NOR] Posted April 23, 2007 Share Posted April 23, 2007 well.. it worked just fine for me... i registered and logged in... it sais i'm logged in now.. no error messages Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 23, 2007 Author Share Posted April 23, 2007 the problem is the fact that my home page just got changed the error came up somewhere else Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 23, 2007 Share Posted April 23, 2007 try posting your code for the affected page Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 24, 2007 Author Share Posted April 24, 2007 ok i fixed one problem! now onto the next one you can go to the link now http://www.getmetola.com/ and u see the error and here is the code for userlogin.php <?php //start the session so you would stay logged in //always must be on top session_start(); //include config.php file include('config.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <?php $p=$_GET['p']; //see my ?id= browsing tutorial switch($p){ default: //if user isn't logged in lets show him the log in form if(!isset($_SESSION['username'])){ ?> <form action='login.php' method='POST'> Username: <input type='text' name='username'><br> Password: <input type='password' name='password'><br> <input name="login" type="submit" value="Submit"><br> Not <a href="register.php">registered</a>? </form> <?} else{ //$_SESSION['username'] = the current users //username. It will be echoed like "Hi, user!" echo "<br><br>Hi, ".$_SESSION['username']."!"; echo "<a href='logout.php'>Log out</a>";} break; case 'page': //you can use it like this or use include() if(!isset($_SESSION['username'])){ echo '<br><br>Log in to see this page!';}else{ echo '<br><br>Only user who is logged in can see this!..and you see this so this means you are logged in;]'; } } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted April 24, 2007 Share Posted April 24, 2007 Viewing the source of your page it appears there is a whole heap of html outputed before you call session_start(). What does config.php look like? Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 24, 2007 Share Posted April 24, 2007 how about config.php? Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 24, 2007 Author Share Posted April 24, 2007 the config.php is very simple <?php $dbhost = 'localhost'; $dbname = 'pokebash_users'; $dbusername = 'username'; $dbuserpass = 'password'; mysql_connect ($dbhost, $dbusername, $dbuserpass); mysql_select_db($dbname) or die('Cannot select database'); ?> Quote Link to comment Share on other sites More sharing options...
trq Posted April 24, 2007 Share Posted April 24, 2007 View the source (right click-> view source) of the page you posted. See all the extra html? its gotta be coming from somewhere. Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 24, 2007 Share Posted April 24, 2007 Okay, I think i see the problem here Are you including the userlogin.php page into your index.php page? If so, you need to move that session_start() to the top of your index page, or if you have a header page, to the top of that. Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 24, 2007 Author Share Posted April 24, 2007 ok Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted April 24, 2007 Author Share Posted April 24, 2007 thannks sanfly!! ;D ;D that really helped and now its fixed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.