SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: is this seriuse
-
Apr 30, 2006, 00:15 #1
is this seriuse
i want to know if this is seruise problem.
Warning: Cannot modify header information - headers already sent by
Notice: A session had already been started - ignoring session_start()
and if its seriuse how to fix it?
thanksNever be shy to ask silly Qs
An answer is always better than none
-
Apr 30, 2006, 00:26 #2
- Join Date
- Aug 2004
- Location
- Earth
- Posts
- 739
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
<?php ob_start(); ?>
at the top of yer page(s) will stop the headers allready sent problem.
hth
-
Apr 30, 2006, 00:40 #3
cool it fixed the problem thanks
but what about the session
Notice: A session had already been started - ignoring session_start()Never be shy to ask silly Qs
An answer is always better than none
-
Apr 30, 2006, 00:45 #4
- Join Date
- Mar 2006
- Posts
- 190
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Are you trying to redirect your visitors to a different page?
-
Apr 30, 2006, 01:08 #5
if the condition have not met yes
if the condition met continue
ob_start();
session_start();
header("Cache-control: private");
if((!isset ($_SESSION["myusername"])))
header("Location: login.php");Never be shy to ask silly Qs
An answer is always better than none
-
Apr 30, 2006, 08:48 #6
- Join Date
- Dec 2004
- Location
- Cornwall, UK
- Posts
- 594
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The first error is because you have sent a header after you have started your output. This is solved with either output buffers (as you've done), or - as is more preferable - by simply moving session_start() to the very top of your script.
The second error means that session_start() has been called twice, the second is obviously superfluous and should be scrapped.
PHP may be configured to start a session automatically, in which case you can use the following:
PHP Code:if(!ini_get('session.auto_start')) {
session_start();
}
Bookmarks