bob...

when using the sesion_start(), it needs to be the 1st thing on the page...

------
<?
  session_start();
.
.
.
?>
<html>
....
....
<?
  $_SESSION['foo'] = 40;
?>
....
</html>
------

i don't recall if there has to be anything within the php.ini file set to
enable sessions...

the reason you're getting the error msg, is that your page has essentially
already "sent" some initial header information to the client by the time it
saw your session_start function...

you can get around this by buffering the output, before you send it...

good luck..


-----Original Message-----
From: Bob Imperial [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 17, 2004 10:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] old guy newbie needs some help


While I realize this is elementary to most of you, I am just getting started
with php, moving from coldfusion :)
I am currently reading through the chapter on sessions and running into a
little issue that after making many changes to my php.ini file, I continue
to get the following errors while running this:

 <?php

  session_start();

 echo "<p>Your session ID is ".session_id()."</p>";

 ?>

Errors:

Warning: session_start(): open(/tmp\sess_ff8651f382492ae56f436690d81ff124,
O_RDWR) failed: No such file or directory (2) in
c:\inetpub\wwwroot\phptest\listing10.1.php on line 15

Warning: session_start(): Cannot send session cookie - headers already sent
by (output started at c:\inetpub\wwwroot\phptest\listing10.1.php:13) in
c:\inetpub\wwwroot\phptest\listing10.1.php on line 15

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
c:\inetpub\wwwroot\phptest\listing10.1.php:13) in
c:\inetpub\wwwroot\phptest\listing10.1.php on line 15

Your session ID is ff8651f382492ae56f436690d81ff124


Warning: Unknown(): open(/tmp\sess_ff8651f382492ae56f436690d81ff124, O_RDWR)
failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that
the current setting of session.save_path is correct (/tmp) in Unknown on
line 0

sorry this is so elementary but have to start somewhere, I am running php 4
on a win2k box w/IIS5.
Though this does return a session id it's obviously not persistent on
reload, an example of a session.save_path on a windows box would be great

TIA  just another old guy trying to learn new stuff.

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

Reply via email to