ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sorry about this lame question, but can anyone tell me what this actually means?
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/******/public_html/dev/*******.php:6) in /home/******/public_html/dev/******.php on line 83
When you send data back from a webserver (and other services such as smtp) there are multiple parts - header information and a message body. The header information always gets sent first and is terminated by a completely blank line. For example - take a look at:
Code:
~> telnet www.google.com 80
Trying 66.102.9.99...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1
HTTP/1.0 200 OK
Cache-Control: private
Content-Type: text/html
Set-Cookie: PREF=ID=2b2b74f7b76b259f:TM=1080504532:LM=1080504532:S=tc5xETjHnzRMF1LT; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
Server: GWS/2.1
Content-Length: 3266
Date: Sun, 28 Mar 2004 20:08:52 GMT
X-Cache: MISS from smoothwall
Connection: close
<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><style><!--
body,td,a,p,.h{font-family:arial,sans-serif;}
.h{font-size: 20px;}
.q{color:#0000cc;text-decoration: none;}
//-->
</style>
...and so on
Therefore if you send any output before you set the cookie you will get the error as above.
by jacksmash Ok, well I'm not really sure as to what I am sending before hand ... Like even before any html?
sort of answered your own question there, anything the effects the header must be sent before the actual page so yes, before <html>
from php.net documentation Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
<html>
<?php
/* This will give an error. Note the output
* above, which is before the header() call */
header('Location: http://www.example.com/');
?>
Note: In PHP 4, you can use output buffering to get around this problem, with the overhead of all of your output to the browser being buffered in the server until you send it. You can do this by calling ob_start() and ob_end_flush() in your script, or setting the output_buffering configuration directive on in your php.ini or server configuration files.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Random RPG Idea Generator - Random roleplaying encounters, random roleplaying plots and stories, random NPCs, random weapons, and more general random roleplaying goodness!</title>
<meta name="author" content="******">
<meta name="keywords" content="random roleplaying encounters, random roleplaying npcs, weapons, random tips, rpg npcs">
<meta name="description" content="Random RPG Idea Generator - Random roleplaying encounters, random roleplaying plots and stories, random NPCs, random weapons, random roleplaying tips and more general random roleplaying goodness!">
<link rel="stylesheet" href="css/main.css" />
</head>
<body>etc. etc....
The php is first here, but it wasn't before (obviously).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.