Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirecting the bp_login_bar – almost got it!

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

  • Burt Adsit
    Participant

    @burtadsit

    It’s tough to read big chunks of code like that above. Use the pastebin http://buddypress.pastebin.com


    devweb
    Participant

    @devweb

    Thanks Burt, will remember in future, however, here is the line of code I am interested in:

    <input type=”hidden” name=”redirect_to” value=”/members/<?php bp_core_get_username() ?>/profile” />

    As per the original post I need some PHP script to call the username that the user has inputted into the username field – to replace the highlighted text above.

    Anyone have any suggestions please let me know!

    Thanks in advance

    DevWeb


    Burt Adsit
    Participant

    @burtadsit

    You are talking about the function bp_login_bar() in the bp-core-templatetags.php file.

    The form field that you are interested in gets set by bp before it arrives at the user’s browser. You don’t know who the user is until they fill out the form and it gets sent back to the server for processing.

    Then they are logged in and you know who they are. It’s too late though because the redirect takes effect after login and they wind up at wherever the hidden field redirect sends them to.

    I think you want to modify the form data before it gets submitted and arrives at the server. You can’t do that using traditional form handling. You’ll have to modify the form data using javascript before it gets sent back to bp.

    You’ll have to investigate something like this:

    http://stackoverflow.com/questions/344451/modifying-form-data-before-submission

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirecting the bp_login_bar – almost got it!’ is closed to new replies.
Skip to toolbar