Need some help with this PHP script

Discussion in 'PHP' started by smetten, Sep 27, 2006.

  1. #1
    http://www.xorak.com/sms.php

    Each time I try to send a msg I get an error on the confirm page. The message is sent anyway but how can i make this error dissappear? Because this error f*cks up my layout.

    This is the error i get:
    Thx in advance

    Greetz

    Smetten
     
    smetten, Sep 27, 2006 IP
  2. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could you post the code. It looks like you have something in front of your code where you are placing the cookies.
     
    Edynas, Sep 27, 2006 IP
  3. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #3
    Headers must be sent first, before any output. This warnings indicate that you have output started at mail.php on line 216. Move your cookies handling (session_start) above line 216.
     
    wmtips, Sep 27, 2006 IP
  4. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #4
    didn´do the trick, still getting the same error, just other line...

    code of mail.php


     
    smetten, Sep 27, 2006 IP
  5. ip076

    ip076 Peon

    Messages:
    79
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to move the session_start() to before any of the output, basically, put it as your first line.
     
    ip076, Sep 27, 2006 IP
  6. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You should put the
    at the beginning of your code.
     
    Edynas, Sep 27, 2006 IP
  7. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #7
    can you show me how the code of the page should look like then?

    Thx

    Greetz

    Smetten
     
    smetten, Sep 27, 2006 IP
  8. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #8
    <?
    session_start ();
    session_register ('sessioncode');
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Xorak.com: Free Worldwide Text Messaging</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
    ...
    
    HTML:
     
    wmtips, Sep 27, 2006 IP
  9. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #9
    Ok,

    many thx to Edynas and Wmtips.

    Greetz

    Smetten
     
    smetten, Sep 27, 2006 IP
  10. cancer10

    cancer10 Guest

    Messages:
    364
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    DONT Send any HTML tage before starting the session
     
    cancer10, Sep 27, 2006 IP
  11. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #11
    penagate, Sep 27, 2006 IP
  12. smetten

    smetten Active Member

    Messages:
    269
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #12
    I know,

    I still need to fix all that stuff on there.

    Thx anyway for pointing that out (will put that link to my bookmarks :) ).

    Greetz

    Smetten
     
    smetten, Sep 27, 2006 IP