This checks to make sure the values are not the same. If they are not required fields on the form, this will need an additional conditional to check if the fields are empty and prevent validation.
if( isset($_POST['submit']) ) {
if( $_POST['box_1'] == $_POST['box_2'] ) {
//set an error action of your choice here
}
}