Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old March 21st, 2004   #1 (permalink)
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
Some help with php

Hey guys, im doing a form login script using mysql. Im using a class file that i wrote to store all of my mysql prodecures.
Now i got this error after parsing in all of my login stuff. The script works basically but im wonderin what do these error's mean?

Thanks

Quote:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at D:\Apache Hosting\index.php:7) in D:\Apache Hosting\index.php on line 51

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:\Apache Hosting\index.php:7) in D:\Apache Hosting\index.php on line 51

Warning: Cannot modify header information - headers already sent by (output started at D:\Apache Hosting\index.php:7) in D:\Apache Hosting\index.php on line 59

__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]
Janus is offline   Reply With Quote
Old March 22nd, 2004   #2 (permalink)
Registered User
 
Join Date: Jun 2002
Location: Montreal
Posts: 6
session_start() must be the first line of your code
__________________
Pat!
Teamz is offline   Reply With Quote
Old March 23rd, 2004   #3 (permalink)
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
nope, that doesnt solve the problem..doh..
anyone else has any idea?
__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]
Janus is offline   Reply With Quote
Old March 23rd, 2004   #4 (permalink)
Administrator
 
Chrono Archangel's Avatar
 
Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,217
Quote:
Originally Posted by Janus
nope, that doesnt solve the problem..doh..
anyone else has any idea?
well whats on line 51 and 59?
Chrono Archangel is offline   Reply With Quote
Old March 24th, 2004   #5 (permalink)
Single
 
SnakeBite's Avatar
 
Join Date: Apr 2002
Location: Norway
Posts: 667
the "headers already sent" message means that you've started outputting the page itself. the headers must be sent before any other data. that seems to be what you're doing wrong.

[edit] the error msgs says output started at index.php:7, which means line 7. I would check what's on line 7 if I were you
__________________
This is my new improved sig.
SnakeBite is offline   Reply With Quote
Old March 24th, 2004   #6 (permalink)
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
Well...line 7 is my < ?php tag.
haha..

hm..i dont get ya snake. care to explain? the part about the headers
__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]

Last edited by Janus; March 24th, 2004 at 13:43.
Janus is offline   Reply With Quote
Old March 24th, 2004   #7 (permalink)
A1C
 
Ramsus K's Avatar
 
Join Date: Jan 2004
Location: California
Posts: 230
The lines before your &lt;?php tag need to be blank if you use session_start() later.
Ramsus K is offline   Reply With Quote
Old March 25th, 2004   #8 (permalink)
Single
 
SnakeBite's Avatar
 
Join Date: Apr 2002
Location: Norway
Posts: 667
that's right. iirc, there's a blank line between the headers and the document itself. iow, you would have to do ALL header-stuff BEFORE outputting ANY data.

[edit] that means all non-php code too. at the begnning of your page, you must start with the php tag, then do all your header work before you start outputting any data.
__________________
This is my new improved sig.
SnakeBite is offline   Reply With Quote
Old March 25th, 2004   #9 (permalink)
The FORCE is my ally
 
lord_muad_dib's Avatar
 
Join Date: Jul 2003
Location: italy
Posts: 176
session calls are headers instuctions

you can't send an header after outputting something...
so you must do all this php stuff at the top of the page..
no spaces before the "< ?php" tag and no echoes
lord_muad_dib is offline   Reply With Quote
Old March 29th, 2004   #10 (permalink)
Single
 
SnakeBite's Avatar
 
Join Date: Apr 2002
Location: Norway
Posts: 667
that's what I'm trying to say. NO output until you're done with the headers.
__________________
This is my new improved sig.
SnakeBite is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 18:20.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5