SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Jun 2006
    Location
    Durban, South Africa
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sessions! Please help

    Hi all

    I have a very weird error here.
    It's been a long road to get to where I am with my script, but I'v literlly taken everything out and there is still a problem.
    This is what my script looks like now

    [script]
    <?php
    session_start();
    ?>
    [/script]

    And this is the error I get.

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at E:\htdocs\outsitename\scriptname.php:1) in E:\htdocs\oursitename\scriptname.php on line 2

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:\htdocs\oursitename\scriptname.php:1) in E:\htdocs\outsitename\scriptname.php on line 2

    I don't have an .htaccess file, so it can't be something in there. The only other thing I can think of is some kind of configuration error, BUT sessions work on other scripts... To give a little background, this script, has an inner frame, and the script in the inner frame, has a session start in it (this has all been taken out now).

    Please can someone help me!
    Don't forget to be awesome

  2. #2
    SitePoint Addict
    Join Date
    Dec 2007
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You probably have some characters right before "<?php".
    It may be, for example, UTF-8 signature or something.
    I'm creating trouble-free Apache, PHP, MySQL installer, WITSuite,
    and use it to setup my development environment.
    Demo, support, contact. Questions?

  3. #3
    SitePoint Addict
    Join Date
    Jun 2006
    Location
    Durban, South Africa
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Thanks for the response.

    I have checked for character before the <?php, but there is nothing there...

    It may be, for example, UTF-8 signature or something.
    What do you mean a UTF-8 signature?
    And how would I check for that? (because it's not visible on screen...)
    Hope my question doesn't sound too dumb... lol

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,510
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    These:

    <?php
    session_start();
    ?>

    are the first three lines of the page? There is nothing before it? Empty line, HTML code, anything?
    It's not included in another page?

  5. #5
    SitePoint Addict
    Join Date
    Jun 2006
    Location
    Durban, South Africa
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have attached a screen shot of my editor.
    Those are literally the only lines in my script...
    Attached Images Attached Images

  6. #6
    SitePoint Addict
    Join Date
    Jun 2006
    Location
    Durban, South Africa
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @ alex.w747

    I think you must have been right!
    I recreated the page, made sure it was just a plain text file, and its working fine.

    Thanks for your help
    Have a good one bye

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For future reference, it's this character:
    http://en.wikipedia.org/wiki/Byte_Order_Mark


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •