Want to update value in database. But it says update() on null

Your verify.php files lives outside WordPress framework, so $wpdb and everything else is not available.

Correct way is to use admin_post_ hook. You can read about it here.

This goes in functions.php

add_action( 'admin_post_add_foobar', 'prefix_admin_add_foobar' );

function prefix_admin_add_foobar() {
    //$wpdb->update()
}

And the form:

<form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post">
  <input type="hidden" name="action" value="add_foobar">
  <input type="hidden" name="data" value="foobarid">
  <input type="submit" value="Submit">
</form>

Simpler but not recommended solution is to init WordPress inside your verify.php file, at the top add (replace ../../../ with correct path to the file):

require_once('../../../wp-load.php');