TeddyKiller Posted June 16, 2010 Share Posted June 16, 2010 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/l/o/s/lostignorance/html/test/includes/Login2/config.php:1) in /home/content/l/o/s/lostignorance/html/test/includes/Login2/session.php on line 18 This seems simple. only it's not. theres no whitespace, nothing being executed before session_start. All it is, is php. My config is the same as this, and it works fine... yet it doesn't on here. Line 18, is session_start, its a class I use on my site and it works fine. This isn't the problem. I am 100% sure of it. This is my page.. <?php include("includes/Login2/config.php"); echo 'Stuffs'; ?> config.php, is as follows <?php define('DB_SERVER', "server"); define('DB_USER', "user"); define('DB_PASS', "pass"); define('DB_NAME', "name"); define("COOKIE_EXPIRE", 31536000); //1 Year require_once("includes/Login2/db.php"); require_once("includes/Login2/functions.php"); require_once("includes/Login2/user.php"); require_once("includes/Login2/session.php"); $database = DatabaseAdapterFactory::factory('mysql', DB_SERVER, DB_USER, DB_PASS, DB_NAME); $database->connect(); $session = new Session; $secret_key = '103041231'; require_once("includes/Login2/form.php"); $form = new Form(); if(isset($_SESSION['uid']) && isset($_SESSION['hash'])) { $user = $session->checkLogin($secret_key); } require_once("includes/Login2/mailer.php"); $mailer = new Mailer(''site name', 'email'); require_once("includes/Login2/settings.php"); $settings = new Settings(); ?> As you see.. no html executed, no whitespace, nothing. Though it doesn't work.. wtf is going on? Seriously need some help. new Session, is when it initializes Session, so thats when it creates a session start Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 16, 2010 Share Posted June 16, 2010 Are you saving your code as UTF-8? If so, make sure it's being save without the BOM characters. If the BOM is being saved, that will give you the message you're seeing. Ken Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted June 16, 2010 Author Share Posted June 16, 2010 Whats the BOM characters? and how do I check if its being saved as UTF-8. I'm using notepad++. EDIT: Just checked in encoding. It's saving it as UTF-8. Quote Link to comment Share on other sites More sharing options...
Jumpy09 Posted June 16, 2010 Share Posted June 16, 2010 My bad! Got confused. Quote Link to comment Share on other sites More sharing options...
Jumpy09 Posted June 16, 2010 Share Posted June 16, 2010 I think he may save as ANSI, I can't remember what the default format is in Notepad++. I save under Unix UTF-8, so I'll confer with him. I believe ANSI was default, but if he is saving under UTF-8, is there any other possibilities which could cause this error? And would ANSI cause this error as well? So .. I shouldn't be saving as UTF-8? I should be saving as UTF-8 without BOM. I'll google again, sorry for being a nub about encoding. Quote Link to comment Share on other sites More sharing options...
jdavidbakr Posted June 16, 2010 Share Posted June 16, 2010 Is that a direct copy and paste from your code? This line mailer = new Mailer(''site name', 'email'); has two single quotes before 'site name', which would throw an error, which could break your session_start() if the error is thrown first. Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted June 16, 2010 Author Share Posted June 16, 2010 Is that a direct copy and paste from your code? This line mailer = new Mailer(''site name', 'email'); has two single quotes before 'site name', which would throw an error, which could break your session_start() if the error is thrown first. No, it had proper values and I editted them. - That was just a typo. Quote Link to comment Share on other sites More sharing options...
Jumpy09 Posted June 16, 2010 Share Posted June 16, 2010 Figured out it was me. I kept having a problem with files uploading wrong so I switched it over to UTF8 without thinking about the consequences. Realized I needed up upload as Binary to get it uploaded right. >.< 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.