It sounds as though have altered the page to submit your data. Assuming that that code work properly:
-
10 require_once( dirname( __FILE__ ) . '/admin.php' );
-
Which fires the
load-{pagenow}
hook330 /** 331 * Fires before a particular screen is loaded. 332 * 333 * The load-* hook fires in a number of contexts. This hook is for core screens. 334 * 335 * The dynamic portion of the hook name, `$pagenow`, is a global variable 336 * referring to the filename of the current page, such as 'admin.php', 337 * 'post-new.php' etc. A complete hook for the latter would be 338 * 'load-post-new.php'. 339 * 340 * @since 2.1.0 341 */ 342 do_action( 'load-' . $pagenow );
That is probably the hook you need, but based on the very generic information you’ve provided it is hard to write much code.