Web Analytics Made Easy -
StatCounter save php file in utf-8 with session_start() in it - CodingForum

Announcement

Collapse
No announcement yet.

save php file in utf-8 with session_start() in it

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • save php file in utf-8 with session_start() in it

    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.

  • #2
    below session_start();
    put this code
    header("Cache-control: private");
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    There are 3 kinds of ppl those who can count and those who cant
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Script-Megafest.com Coming Oh so very soon

    Comment


    • #3
      i try that it is not working

      Comment


      • #4
        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?

        Comment


        • #5
          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.
          PHP Code:
          header('HTTP/1.1 420 Enhance Your Calm'); 
          Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

          Comment


          • #6
            did you remember to use ";" at the end of sesion_start()
            -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            There are 3 kinds of ppl those who can count and those who cant
            -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            Script-Megafest.com Coming Oh so very soon

            Comment


            • #7
              i am also working on notepad for my source code

              Originally posted by Fou-Lu
              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.

              Comment


              • #8
                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.

                Originally posted by Al_90
                did you remember to use ";" at the end of sesion_start()

                Comment

                Working...
                X