PDA

View Full Version : save php file in utf-8 with session_start() in it


bbmak
07-31-2005, 08:03 PM
HI:
I don't know is anybody encounter this problem before. When I try to save my file in uft-8 with a session_start() at the top. This message will show up session_start(): Cannot send session cache limiter - headers already sent
It is saying that something run before session_start(), but i already put session_start() on the top of the top of the page.
==================================
For example:
you can try this by yourself

try to save this file in utf-8, and you will see the problem.
also try to save this file in ASCI, the error will disappear
<?
session_start()
?>
==================================
After there anyone know how to solve this problem because i am doing muti-lingle websites all the time.

Al_90
07-31-2005, 08:09 PM
below session_start();
put this code
header("Cache-control: private");

bbmak
07-31-2005, 08:28 PM
i try that it is not working

bbmak
07-31-2005, 08:52 PM
i know when i save the file to utf-8, the file will send the 3 bytes before everything (EF BB BF), so i wonder are there anyway i can save the file into utf-8 with session_start() in it?

Fou-Lu
07-31-2005, 09:05 PM
Good 'ol notepad. Never get errors like these. Wordpad is bad BTW.
Your right though, the error is due to the output prior to your <?php tags. I'm not certain output buffering will work for you either...
Anyways, change the application you are working with, and you will be good to go. My understanding is that there are many different php developement applications available for use. I'm however old fashioned and prefer the notepad route. Just search the forums here for php development and you'll surely pull some results on apps available.

Al_90
07-31-2005, 10:11 PM
did you remember to use ";" at the end of sesion_start()

bbmak
07-31-2005, 11:18 PM
i am also working on notepad for my source code

Good 'ol notepad. Never get errors like these. Wordpad is bad BTW.
Your right though, the error is due to the output prior to your <?php tags. I'm not certain output buffering will work for you either...
Anyways, change the application you are working with, and you will be good to go. My understanding is that there are many different php developement applications available for use. I'm however old fashioned and prefer the notepad route. Just search the forums here for php development and you'll surely pull some results on apps available.

bbmak
07-31-2005, 11:21 PM
oh yes, i remember that, but i just forgot to type when i make the post because kind of in hurry to work.

i think this utf-8 is a bug of php, i heard one of my friends said, you can use utf-8 and session_start(); by enabling zend mutibyte, but i never try it because i rent the server. so i can not compile that.

did you remember to use ";" at the end of sesion_start()