Thread: Header error

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    15
    Rep Power
    0
    I had below error on my page:

    Warning: Cannot add header information - headers already sent by (output started at functions.php:1) in /home/victor/www/cart_action.php on line 89

    cart_action.php is a php file without interface but just doing re-direction using Header().

    functions.php is a file contain inside cart_action.php which do not have any interface but contain several functions written by me.

    This happen suddenly, and I am very sure that I didn't output or echo anything before the header(), what is the possible problem like?

    Thanks.

    vic
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    vic,
    Don't put any space before your php deliminator(ie,..'<?')..That is why it's showing the error message...

    it should be..
    ----
    <?

    header(...

    ?>




    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    15
    Rep Power
    0
    Hi, thanks for the help.
    But I already put as "<?php" without any space.
    If I combine 2 scripts together, then everything works fine. -_-....
    Any suggestion on that?

    Thanks.

    vic
  6. #4
  7. No Profile Picture
    a total freak
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    33
    Rep Power
    15
    is the php script planted after any html tags?
    try adding the php script before any html tags.. such as..

    ...
    <?php

    header(..

    ?>
    <html><head>
    ...

    from what i know, headers only work if they are called before the <head> tag, thats why the error code had the word headers already sent by..


    ------------------
    ---freakyG!---
    kinumedia, web developer
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    15
    Rep Power
    0
    Thanks, but these 2 scripts do not contain any html tag, just the php code, I already check the code for any possible outputstream, but seems like I can't found any. Any suggestion on that?

    Thanks,
    vic
  10. #6
  11. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    You have some whitespace either before the <? or after ?> in the included file

Similar Threads

  1. Codepupil
    By Adachic in forum C Programming
    Replies: 3
    Last Post: February 6th, 2004, 06:50 PM
  2. syntax error : identifer 'Hole'
    By bootrecker in forum C Programming
    Replies: 2
    Last Post: February 2nd, 2004, 08:08 AM
  3. Replies: 4
    Last Post: January 28th, 2004, 08:29 AM
  4. mysql: getting error description from error code
    By laker in forum PHP Development
    Replies: 1
    Last Post: January 21st, 2004, 06:03 AM
  5. I don't know what this error message means
    By lcham02 in forum Java Help
    Replies: 2
    Last Post: January 13th, 2004, 11:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo