0
 if ( !$bad_input ) {
    $user_id = bb_new_user( $user_login, $_POST['user_email'], $_POST['user_url'] );
    if ( is_wp_error( $user_id ) ) { // error
        foreach ( $user_id->get_error_codes() as $code )
            $bb_register_error->add( $code, $user_id->get_error_message( $code ) );
        if ( $bb_register_error->get_error_message( 'user_login' ) )
            $user_safe = false;
    } elseif ( $user_id ) { // success
        foreach( $profile_info_keys as $key => $label )
            if ( strpos($key, 'user_') !== 0 && $$key !== '' )
                bb_update_usermeta( $user_id, $key, $$key );
        do_action('register_user', $user_id);

        //HERE I WANT TO LOAD A HTML PAGE
        exit;   
    } // else failure
}

I am trying to modify bbPress php file. This handles registration and I want to load another HTML file stored in local machine after user finish the registration.

1 Answer 1

1

include()

http://php.net/manual/en/function.include.php

Yep, try the old include function.

 if ( !$bad_input ) {
    $user_id = bb_new_user( $user_login, $_POST['user_email'], $_POST['user_url'] );
    if ( is_wp_error( $user_id ) ) { // error
        foreach ( $user_id->get_error_codes() as $code )
            $bb_register_error->add( $code, $user_id->get_error_message( $code ) );
        if ( $bb_register_error->get_error_message( 'user_login' ) )
            $user_safe = false;
    } elseif ( $user_id ) { // success
        foreach( $profile_info_keys as $key => $label )
            if ( strpos($key, 'user_') !== 0 && $$key !== '' )
                bb_update_usermeta( $user_id, $key, $$key );
        do_action('register_user', $user_id);

        include('path/to/file.html');
        exit;   
    } // else failure
}
Sign up to request clarification or add additional context in comments.

2 Comments

include() will try to execute the code, which may or may not be desirable. To simply stream its contents to the user, try readfile() instead.
You could include a php file there that outputs the html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.