开发者

PHP, How to navigate to another HTML file in PHP code

开发者 https://www.devze.com 2023-02-14 01:04 出处:网络
if ( !$bad_input ) { $user_id = bb_new_user( $user_login, $_POST[\'user_email\'], $_POST[\'user_url\'] );
 if ( !$bad_input ) {
    $user_id = bb_new_user( $user_login, $_POST['user_email'], $_POST['user_url'] );
    if ( is_wp_error( $user_id开发者_JAVA技巧 ) ) { // 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.


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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消