php issue on my website.

Aijelsop

Question Asker
OP
Member
Joined
Sep 11, 2010
Messages
1,000
Trophies
0
XP
815
Country
United States
I'm not experienced in php at all. Something's messed up here, but I can't find what.

Here:
CODE
Welcome back !

My Profile | Logout

Welcome Guest!

Login | Register


This is what shows up on my site:
Code:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/LOLNO/public_html/index.php:49) in /home/LOLNO/public_html/index.php on line 52

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/LOLNO/public_html/index.php:49) in /home/LOLNO/public_html/index.php on line 52
Welcome Guest!
Login | Register

Help would be MUCH appreciated.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
session_start(); should be at the top of your page, before the first written character on your html generated webpage.

even space or newline will give an error.
If your page is in UTF-8, use without BOM.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
There are two way to identify a UTF-8 document.
Either using a header (a specific 3 or 4 bytes called BOM (Byte_order_mark) before the first character written in the file), or without that header.
This BOM is not require in UTF-8 as the byte order to write the characters are the same as the ANSI files, so it can be omitted.

If the header is not present, the UTF-8 is recognized by checking how the letters are coded inside the document. all special letters (like accents éàç etc.) are coded on 2 bytes instead of 1.

The problem here is that this header is read and interpreted before the first written character by PHP.


Your text editor program should have something like Convert/save to :
UTF-8 without BOM
ANSI as UTF-8
It could be something else, like "no header" etc.
 

Aijelsop

Question Asker
OP
Member
Joined
Sep 11, 2010
Messages
1,000
Trophies
0
XP
815
Country
United States
cpsPu.png


I'll look through the list

Can't find those, ugh.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
That's strange.
What program is it?
Try searching on google "name of your prog UTF-8 BOM"

It should have both available, especially if it's a web oriented program.
If not, I would recommend you try another text editor (Notepad++ is very good).
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
I didn't find anything useful regarding that online editor and the BOM problem.
And it's designed to be a webpage editor!

I think you could send a message to the website manager. There should be a way to save without the BOM, or else it's really an unuseful web page editor
frown.gif


Edit:
Also, do you have a way to download the files to your computer to really check if the BOM is present?
Maybe they are always saving without the BOM and the error is caused by something else.

Your configuration.php doesn't output a text? or doesn't have a space before the first
 

Aijelsop

Question Asker
OP
Member
Joined
Sep 11, 2010
Messages
1,000
Trophies
0
XP
815
Country
United States
QUOTE said:
Also, do you have a way to download the files to your computer to really check if the BOM is present?
Maybe the error is caused by something else.

Yeah, I just downloaded it.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
if you have notepadd++, it will tell you if it's UTF-8 or Ansi as UTF-8, you can convert it easily in the encoding menu.
If you have a hexeditor, check the first bytes.
If it starts with "ef bb bf" it's the BOM. delete it and put it back to your website.
 

Aijelsop

Question Asker
OP
Member
Joined
Sep 11, 2010
Messages
1,000
Trophies
0
XP
815
Country
United States
Hmmm, it's encoded in ANSI, so I converted it to utf-8 Without BOM and re-uploaded it but nothing happened
ohnoes.png
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
So, you really have a space or a newline, or a header info somewhere in your code.
Check all included files, like your configuration.php

You have to delete all space outside the php tags before calling the session_start().
OR, you could place the session_start(); in your configuration.php
tongue.gif


Could you paste the content of the files ? (or make a zip of it, so I can check. I'm faithful (damn, I have a bad english) trustworthy about your confidentiality, don't worry
tongue.gif
).


Edit :
Oh, I just thought !
The website is a free hoster?
Often, free host providers are generating headers themselves to place advertisings !
 

Aijelsop

Question Asker
OP
Member
Joined
Sep 11, 2010
Messages
1,000
Trophies
0
XP
815
Country
United States
Gahh, I gotta go. Hopefully these are sucessful when I try them later.

Thanks for your help.
biggrin.gif


QUOTE said:
Oh, I just thought !
The website is a free hoster?
Often, free host providers are generating headers themselves to place advertisings !

Yes, but it is ad free.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
check your error :
(output started at /home/LOLNO/public_html/index.php:49) in /home/LOLNO/public_html/index.php on line 52
check both line 49 and 52 of index.php, it should hint you where the problem is located.

Good luck.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Least they got head in the end