Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   session_start() problem (http://www.programmingforums.org/showthread.php?t=7247)

DigitalSeraph Nov 28th, 2005 12:37 PM

session_start() problem
 
ok, i have a mysql database holding the user info

i also have a script which changes the user's info.this script is in its own file(changeinformation.php) i have to call start_session() to get the session variables to change them.once these vars are loaded, the databse is then updated with the changed variables.

i keep getting this error tho:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /mnt/web_f/d40/s09/b0263a64/www/changeInfo.php:2) in /mnt/web_f/d40/s09/b0263a64/www/changeInfo.php on line 3
Problem

here is the code for it:

1
2<?php
3 session_start();
4
5 if (isset($_SESSION['username']))
6 {
7 get info and do stuff
8 }else
9 exit;
10 }
?>

this isnt the actual code, im just showing you where session_start() is in the code.

please help

Ooble Nov 28th, 2005 1:32 PM

session_start(); must be called before any output is sent.

Lich Nov 28th, 2005 11:44 PM

move the <?php to line 1

Ooble Nov 29th, 2005 7:32 PM

Quote:

Originally Posted by Lich
move the <?php to line 1

Nice one. How'd ya manage to spot that?


All times are GMT -5. The time now is 8:46 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC