I bet you have some session management functions in
  include('lib/sessionfunc.php');
something like session_start() that also sends out header informations,
but you can't send any headers AFTER you have started
the output for eg:
<?
    .... some cookies/session/header code1
?>
Some HTML output like:
<html>
<head>
<?
    .... some cookies/session/header code2
?>

code1 will work ok, but code2 will fail with headers already sent error.
Instead you should write :
<?
 ALL cookies/session/header code
?>
The HTML code
<?
other PHP code
?>

the headers are sent before any HTML code, so if you have even one
blank space sent to the output you can't modify the headers any more.





"Brian J. Celenza" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Here's a snippet of the code. I'm sending the setcookie header out long
> before any of the other headers, but I'm still getting:
> Warning: Cannot modify header information - headers already sent by
(output
> started at C:\wwwroot\index.php:4) in C:\wwwroot\index.php on line 7
>
> -----Code------
>
> <?
> function cookie_set($userid){
>  if (isset($userid)){
>   setcookie("vfsnet", $userid, time()+600);
>  }
> }
> cookie_set($_GET['user']);
> ?>
> <html>
> <head>
> <?
>
>  include('lib/sessionfunc.php');
>  include('lib/dbconnect.php');
>  include('lib/filefunc.php');
>  include('lib/urlfunc.php');
> ?>
> <link rel="stylesheet" type="text/css" href="themes/master.css">
> <title>Website0001</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> ---Code---
>
> Any ideas?
>
> Thanks
> Brian
>
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to