<?php wp_nonce_field( 'name_of_my_action', 'name_of_nonce_field' ); ?>
if (
! isset( $_POST['name_of_nonce_field'] )
|| ! wp_verify_nonce( $_POST['name_of_nonce_field'], 'name_of_my_action' )
) {
print 'Sorry, your nonce did not verify.';
exit;
} else {
// process form data
}