I'm trying to use PHP4 "sessions' on my site, and I'm running into sessions header problems.
I have a series of customer registration pages that are linked sequentially:
1. register1.php -- simple page, no form, linked to register2.php
2. register2.php -- contains form, sends results to register3.php (action="register3.php")
3. register3.php -- stores results from register2.php and contains another form, sends results to register4.php (action="register4.php")
4. register4.php -- stores results from register3.php and thanks customer for registering
When I include a "session_start()" statement on register1.php page, I get a SID on each of the subsequent pages. (I don't have any sessions variables to register until the register3.php page.) However, if I place a "session_start()" statement on any of the other pages, register2,3 or 4, I get an error message. For example, if I place a "session_start()" statement on the register2 page, I get the following error message:
"Warning: Cannot send session cache limiter - headers already sent (output started at ... / register2.php:7) in ... / register 2.php on line ..."
If I remove all "session_start()" statements except the one on the register1.php page, I get no error messages. But when I try to add "session_register" statements on the register3.php page, I again get the same error message as above -- except the error message reference is to register3.php.
I suppose I could put all of my registration process on one long page, rather than breaking it into several steps. But I'd rather not.
Am I doing something incorrectly with "sessions" or is there a way to work around my problem?