Skip to:
Content
Pages
Categories
Search
Top
Bottom

headers already sent error in ajax.php

  • i have searched on google to solve this problem and done almost everything but cannot get rid of this error. i am new to php and do not know what is going wrong. the last two lines of the code mentioned below in the ajax.php file which is responsible for the error.

    ‘ if ( $friends ) {
    foreach ( (array)$friends as $user_id ) {
    $ud = get_userdata($user_id);
    $username = $ud->user_login;
    echo bp_core_fetch_avatar(array(‘item_id’ =>$user_id,’type’=>’thumb’,’width’=>15,’height’ =>15)).’ ‘.bp_core_get_user_displayname($user_id).'(‘.$username.’)’;
    } ‘

    i would be grateful if someone can help me and point out what is wrong with the code.

    regards
    amit

Viewing 5 replies - 1 through 5 (of 5 total)

  • @mercime
    Participant

    @mercime

    What is the complete error warning? You might be looking at ajax.php when the problem is the phrase before that and the victim is ajax.php. See https://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

    thank you mercime for replying. its the ajax.php that is the problem. this is the error that i get

    ‘Warning: Cannot modify header information – headers already sent by (output started at /…./public_html/chill/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php:553) in /…./public_html/chill/wp-content/plugins/buddypress/bp-messages.php on line 556’. i have already checked the above link.

    line 553 in ajax.php is this below line code:

    ‘echo bp_core_fetch_avatar(array(‘item_id’ =>$user_id,’type’=>’thumb’,’width’=>15,’height’ =>15)).’ ’.bp_core_get_user_displayname($user_id).’(‘.$username.’)’;
    } ‘

    regards
    amit

    can anyone help me with this issue.


    danbpfr
    Participant

    @chouf1

    Download a new ajax.php file corresponding to your BP version from the trac.
    https://trac.buddypress.org/browser?order=name#tags

    You probably have some whitespace somewhere.

    Hi i am having the same issue with replying to peoples post in activity…

    Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/public_html/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php:142) in /home/xxxx/public_html/wp-includes/pluggable.php on line 693

    Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/public_html/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php:142) in /home/xxxx/public_html/wp-includes/pluggable.php on line 694

    Warning: Cannot modify header information – headers already sent by (output started at /home/xxxx/public_html/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php:142) in /home/xxxx/public_html/wp-includes/pluggable.php on line 695

    I have also downloaded the new file and checked for any whitespace and was unable to find any.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘headers already sent error in ajax.php’ is closed to new replies.
Skip to toolbar