The Loop is PHP code used by WordPress to display posts. You can see how a loop is constructed on generatewp.com.
// WP_Query arguments
$args = array ();
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while( $query->have_posts() ) {
$query->the_post();
$post = get_post();
if ( isset( $_POST[ 'jolly' ] ) ) {
update_post_meta( $post->ID, 'jolly', $_POST[ 'jolly' ] );
}
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
<form action='' method='POST'>
<input type="submit" name="jolly" value="test"/>
</form>