By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,983 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,983 IT Pros & Developers. It's quick & easy.

Warning Messages Using Session Control

P: n/a
I added session control to my survey application. I want to retain the
person's name entered on the 1st page and use it as a variable value on
subsequent pages.

I added on the first script:

Sep 15 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Once output has been sent to the browser headers cannot be sent.
Sending headers is how cookies are set (like session cookies), so you
get the errors described.

Somewhere in your script before session_start() you're sending output
to the browser. In fact, the error message even tells you the file and
line number where the output was sent (although in your post you cut
that part out).

Check the code listed in the error message. Even sending a single
blank space counts. You can ensure that no output is sent before
calling session_start() by using ob_start() and ob_flush() -- although
the correct solution is to probably rearrange your script so
session_start() gets called earlier on.

Sep 15 '05 #2

P: n/a
bobkaku wrote:

I added on the first script:


Don't use session_register - reference a mamber of the $_SESSION array
directly e.g.

print $_SESSION['MyVar'];

Otherwise your code will only work if register_globals is on (nothing to do
with the error messages you were getting - see Zeldor's response)

Sep 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.