How to receive data on other server with wp_remote_post

So basically, I’m posting data with wp_remote_post, and I want to receive sent data (username and password) on other server. How would I do that? I tried <?php echo $_POST['username']; ?> (nothing else before or nothing else after), but it didn’t work. Can’t find it either in WordPress Codex.

Related posts

Leave a Reply

1 comment

  1. WordPress protects you from so it’s harded to exploit your code.

    Use this code to make it work:

    in functions.php add:

    add_filter('query_vars', 'add_my_var');
    function add_my_var($public_query_vars) {
        $public_query_vars[] = 'username';
        return $public_query_vars;
    }
    

    and then you can use in your code to read the variable:

    get_query_var('username');
    

    This thread helped: http://wordpress.org/support/topic/using-an-extra-parameter-in-an-url