Jump to content

[SOLVED] Annoying error message with sessions?


Roy766

Recommended Posts

Hi everybody! I'm somewhat new to sessions, so this question may seem really stupid to all of you PHP gods.

 

Anyways, I'm trying to send a basic PHP variable between two pages through the use of sessions, and then I do some basic computations on the second page. The math I get on the second page is right, but I get these annoying error messages at the top of the page:

 

First page:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/www/roy766.freehostia.com/armygame.php:6) in /home/www/roy766.freehostia.com/armygame.php on line 8

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/roy766.freehostia.com/armygame.php:6) in /home/www/roy766.freehostia.com/armygame.php on line 8

 

Second page:

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/www/roy766.freehostia.com/armygame2.php:6) in /home/www/roy766.freehostia.com/armygame2.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/roy766.freehostia.com/armygame2.php:6) in /home/www/roy766.freehostia.com/armygame2.php on line 7

 

If someone could help it would be greatly appreciated! Thanks in advance!

 

Side-note:

  session_register();
  session_start();                      
  $_SESSION['budget'] = $budget;

 

 session_start();
$budget = $_SESSION['budget'];

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.