Skip to:
Content
Pages
Categories
Search
Top
Bottom

Php plugin error – login

  • Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    To redirect my users after they login, I set up a bp-custom.php file and uploaded it, as discussed here:

    http://buddypress.org/forums/topic.php?id=1095

    Then I received the following error:

    Warning: Unexpected character in input: \\\’\\\\\\\’ (ASCII=92) state=1 in /…/wp-content/mu-plugins/bp-custom.php on line 9

    Parse error: syntax error, unexpected T_FUNCTION in /…/wp-content/mu-plugins/bp-custom.php on line 10

    Can anyone help me figure out how to fix this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    You have a syntax err in the code somewhere. We can’t help you without seeing the code. Paste the function here.

    Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    Okay, here’s the code. I cut and pasted it from the forum and added the php open and close :

    <?php

    function oci_login_redirect($redirect_to, $set_for, $user){

    $redirect_to = bp_core_get_userurl($user->ID);

    return $redirect_to;

    }

    add_filter(‘login_redirect’, ‘oci_login_redirect’, 10, 3);

    ?>

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    The code you pasted has seven lines. But the error message mentions issues on line 9 and 10.

    Remove all the spaces after the closing “?>” tag. Save the file. Retry.

    Spaces after the terminal closing tag cause a lot of problems.

    Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    Thanks again, Jeff! When I went into the file, there were extra spaces and a few slashes that I didn’t put in there (they may have come from my cut and paste).

    Anyway, it works perfectly now.

    :)))))

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    Great!

    Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    And thanks to Burtadsit for the code/plugin idea. It’s a great one!

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

You must be logged in to reply to this topic.