you have to have the session_start before ANY output, including <html>, so do this
<? session_start() ?> <html> On Thu, 22 Jul 2004 00:56:44 +0800, Sheawh <[EMAIL PROTECTED]> wrote: > even Example: page1.php > I got the same result, > and what if i set session auto start ?? > is that means it starts a new session when accessing a HTML? > > <HTML> > .... > <?php > // page1.php > > session_start(); > > echo 'Welcome to page #1'; > > $_SESSION['favcolor'] = 'green'; > $_SESSION['animal'] = 'cat'; > $_SESSION['time'] = time(); > > // Works if session cookie was accepted > echo '<br /><a href="page2.php">page 2</a>'; > > echo "SID : " . session_id(); > // Or maybe pass along the session id, if needed > echo '<br /><a href="page2.php?' . SID . '">page 2</a>'; > ?> > .... </HTML> > > "Torsten Roehr" <[EMAIL PROTECTED]> ¦b¶l¥ó > news:[EMAIL PROTECTED] ¤¤¼¶¼g... > > > > "Sheawh" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > I have started a session using session_start(); > > > but it returns : > > > > > > Warning: Cannot send session cookie - headers already sent by (output > > > started at c:\inetpub\wwwroot\diary\index.php:7) in > > > c:\inetpub\wwwroot\diary\reg_session.php on line 11 > > > > > > Warning: Cannot send session cache limiter - headers already sent > (output > > > started at c:\inetpub\wwwroot\diary\index.php:7) in > > > c:\inetpub\wwwroot\diary\reg_session.php on line 11 > > > > > > > > > If I don't want to use session cookie , how to set it? > > > thanks. > > > > No output is allowed before starting the session. Look at the user > comments > > in the manual and search the mailing list archives. > > > > Regards, Torsten Roehr > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php