Jump to content

PHP Session Error


Bman900

Recommended Posts

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>

 

Link to comment
https://forums.phpfreaks.com/topic/188655-php-session-error/
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/188655-php-session-error/#findComment-995971
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.