CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Location
    slavia
    Posts
    42

    Question problem when mixing session in PHP with ajax

    dear all,
    i just start my way to learn AJAX
    i am using a simple framework
    AJAXGOLD.JS

    i am tryin to make an application that combine the use of AJAX with session in PHP. but i got this message, when i do the 'session'-ing
    this is the warning.
    Code:
    Warning: 
    Cannot send session cache limiter - headers already sent 
    (output started at c:\apache\htdocs\ajax\lat2_ajaxgold\chat.php:3) in
    c:\apache\htdocs\ajax\lat2_ajaxgold\chat.php on line 6
    if there is any idea of how to handle session + AJAX,
    or give the links, i'd be very thankful

    rgrds,

    szpilman
    Last edited by szpilman; October 18th, 2006 at 10:59 AM. Reason: view of the warning is too wide not so

  2. #2
    Join Date
    Nov 2005
    Posts
    49

    Re: problem when mixing session in PHP with ajax

    When I call the function session_start() but before calling it some thing is going to be print on browser then this warning shown. For example
    Code:
    <html>
    <?
    if(!isset($_SESSION))
      session_start();
    ?>
    </html>
    This will show a warning!

    But following code will not show warning:
    Code:
    <?
    if(!isset($_SESSION))
      session_start();
    ?>
    <html>
    ......................
    </html>
    Muhammad Waqas Badar

  3. #3
    Join Date
    Oct 2006
    Location
    slavia
    Posts
    42

    Re: problem when mixing session in PHP with ajax

    thnx Badar
    u got it right. i have corrected my code. some of the errors were also caused by incompatibilities in PHP functions that i used in my PHPTriad but i have resolved it. thnx badar

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured