• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution

    PHP header function not working

    HI ,

     

    My header function from PHP is not working. I got error "Headers already sent.."

     

    I want to off output_buffering option from PHP. But this option is not exists in PHP options from cpanel. Can you please help me for it?

    1 ACCEPTED SOLUTION
    Retired
    Not applicable

    Hi @Abhijeet,

    haven't much time today but "headers already sent" error usually means that something has gone before the headers. A space, a period a hidden character or even an empty line. 

    The system reads these as the header instead of the real header. 

    Never use word processors for any editing of site files. Never copy and paste either. 

    View solution in original post

    3 REPLIES 3
    Retired
    Not applicable

    Hi @Abhijeet,

    haven't much time today but "headers already sent" error usually means that something has gone before the headers. A space, a period a hidden character or even an empty line. 

    The system reads these as the header instead of the real header. 

    Never use word processors for any editing of site files. Never copy and paste either. 

    View solution in original post

    I checked whitespaces also. And where shoul I edit my code then, can you please guid me?

     

    And now I implemented redirection using javascript function. It's working here now.

    Retired
    Not applicable

    Hi @Abhijeet,

    in the middle of moving home but......

    use notepad on windows, or codeblocks (free). Or any other real editor rather than word processor. Word processors add formatting characters etc. If you must use a word processor then make sure the plain text settings are chosen. 

    Do not use Word etc. 

     

    Vim or emacs are the best editors that a professional developer would use. Most like BBEdit write half of the code for you with suggestions as you type. Powerful but you get lazy. 

    I couldn't guide you in the use of say vim as there is some serious learning and docs to become proficient in the use of it, and no easy way. But someone good with vim is worth their weight in gold......... and know it I may add. 😊