I have include wp-config, should I add global $wpdb also?

If you need a processing endpoint with access to the WordPress API, use the admin_post_ action and eliminate the need to manually include wp-config.php or any other WordPress files.

// add for logged-in visitors
add_action( 'admin_post_your_action', 'prefix_your_action_function' );
// for non logged-in visitors
add_action( 'admin_post_nopriv_your_action', 'prefix_your_action_function' );
function prefix_your_action_function() {
    global $wpdb;
    // your processing code here
}

Use admin_url to target the file in WordPress context, like:

echo admin_url( 'admin-post.php?action=your_action' );

You can GET or POST whatever additional data you need to pass.