Bman900 Posted January 16, 2010 Share Posted January 16, 2010 So I get this message: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /homepages/44/d272374679/htdocs/blog/index.php5:4) in /homepages/44/d272374679/htdocs/blog/index.php5 on line 5 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/44/d272374679/htdocs/blog/index.php5:4) in /homepages/44/d272374679/htdocs/blog/index.php5 on line 5 I am running PHP 5 on my PC and on my hosting yet I get no errors on my PC while running my code but once I uploaded that to the server I got them and can't explain it. Here is my code at and around line 5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php session_start(); //line 5 is here $dbuser = "dbo314611366"; $dbpass = "rabbitowner"; $dbhost = "db2225.perfora.net"; $dbname = "db314611366"; ?> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> Quote Link to comment https://forums.phpfreaks.com/topic/188655-php-session-error/ Share on other sites More sharing options...
Bman900 Posted January 16, 2010 Author Share Posted January 16, 2010 Alright so apparently if I started the session at the VERY top of the page it works fine again but what I don't understand is that I never sent any HTML out before anyway so it should have worked, right? Quote Link to comment https://forums.phpfreaks.com/topic/188655-php-session-error/#findComment-995970 Share on other sites More sharing options...
PFMaBiSmAd Posted January 16, 2010 Share Posted January 16, 2010 Ummm. A HTML doctype, a HTML <html> opening tag, and a HTML <head> tag are all HTML... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> Quote Link to comment https://forums.phpfreaks.com/topic/188655-php-session-error/#findComment-995971 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.