cameeob2003 Posted July 4, 2006 Share Posted July 4, 2006 I am getting the following errors:[quote]Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/34/d154144477/htdocs/ventgaming/n2p/login.php:22) in /homepages/34/d154144477/htdocs/ventgaming/n2p/index2.php on line 224[/quote]I was wondering what this error is caused from. I read on a dif forum that it can be from spaces outside of code but I have none and still recieve this error. Quote Link to comment https://forums.phpfreaks.com/topic/13685-session_start-functionsession-start-cannot-send-cache-limiter-headers/ Share on other sites More sharing options...
trq Posted July 4, 2006 Share Posted July 4, 2006 Are you outputing anything to the browser before calling sesstion_start()? Quote Link to comment https://forums.phpfreaks.com/topic/13685-session_start-functionsession-start-cannot-send-cache-limiter-headers/#findComment-53092 Share on other sites More sharing options...
cameeob2003 Posted July 4, 2006 Author Share Posted July 4, 2006 no i am not calling anything before it.it is just:[code]<html><body><div style="position: absolute; top: 191px; left: 260px;"><?phpsession_start();if(!$_SESSION['user']){ echo "<font id=UserPanelText />You are not logged in.<br/><br/>";}else{ echo "You are logged in as:". $_SESSION['username'] ."<br/><br/>"; } $newpms = $_SESSION['priv_messages']; if($newpms > "0"){ echo "<a href=?page=newpmessage=$id>Unread Messages</a> (". $newpms .")<br/>"; }else{ echo "<font id=UserPanelText /><a href=?page=pmessages=$id>Mailbox</a><br/><font id=UserPanelText /><a href=?page=user_panel>User Panel</a><br/>"; } ?></div></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13685-session_start-functionsession-start-cannot-send-cache-limiter-headers/#findComment-53094 Share on other sites More sharing options...
cameeob2003 Posted July 5, 2006 Author Share Posted July 5, 2006 here is my login.php[code]<?php$user = $_POST['username'];$pass = $_POST['password'];$user=str_replace(" ","",$user);//remove spaces from username$pass=str_replace(" ","",$pass);//remove spaces from password$user=str_replace("%20","",$user);//remove escaped spaces from username$pass=str_replace("%20","",$pass);//remove escaped spaces from password$user=addslashes($user);//remove spaces from username$pass=addslashes($pass);//remove spaces from password// connect to mysql db$conn = mysql_connect("db411.perfora.net","dbo168663394","w.N6n7gG");mysql_select_db("db168663394");$request = "SELECT * FROM users WHERE password='".$pass."' AND username='".$user."'";$results = mysql_query($request,$conn);if(mysql_num_rows($results))//function returns true if any matches are found{ echo "User Logged in."; $_SESSION['user'] = $user; $_SESSION['auth'] = true; include("index2.php");}else{ echo "User Name/Password Not Found."; $_SESSION['auth'] = false; include("index.php");}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13685-session_start-functionsession-start-cannot-send-cache-limiter-headers/#findComment-53099 Share on other sites More sharing options...
trq Posted July 5, 2006 Share Posted July 5, 2006 [quote]i am not calling anything before it[/quote]Whats this then?[code]<html><body><div style="position: absolute; top: 191px; left: 260px;">[/code]scotch mist?Read [url=http://www.phpfreaks.com/forums/index.php/topic,37442.0.html]this[/url] sticky. Quote Link to comment https://forums.phpfreaks.com/topic/13685-session_start-functionsession-start-cannot-send-cache-limiter-headers/#findComment-53103 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.