get method in form instead of post

I am showing a list of users in a plugin page in wordpress admin panel.
This bit of code is used to show search form and results of the search.

<form method="post">
            <?php
            $obj->prepare_items();
            $obj->search_box('search', 'search_id');
            $obj->display();
            ?>
</form>

If i change method from “post” to “get” i get a blank page.

In prepare_items users are retrieved using $_REQUEST

$users = get_users(
      array(
        'meta_key' => 'last_name',
        'search' => '*' . esc_sql( $_REQUEST['s'] ) . '*',
        'orderby' => $orderby,
        'order' => $order,
        'offset' => $offset,
        'number' => $per_page
      )
    );

Do i need some coding based on GET parameter?

Read more here: get method in form instead of post

Leave a Reply

Your email address will not be published. Required fields are marked *