> 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>
>

Try this:

<?php
session_start();
?>

<HTML>

blah blah blah

</HTML>

session_start() needs to go before any HTML is outputted (is that a word?).

--Matthew Sims
--<http://killermookie.org>

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

Reply via email to