You really need to take a step back and try to understand what foreach does. This is a really silly piece of code:
foreach($data as $values) {
$values = $_POST[$values];
}
it says "set the $values var to each of the values in $data, one at a time, and after you set it to each item in $data, then just set it to whatever's in $POST[$values]". It accomplishes nothing except that when the loop completes, $values will be set to $POST['size']. Also, it's bad form to redefine either variable in your foreach statement in the loop itself.
Try reading the documentation on [man]foreach[/man].