I think the scope of $datainfo isn't set properly. You are initializing it inside a foreach loop which means that it is being recreated on each loop. Try this instead.
Code:
// Initialize variable outside foreach scope.
$datainfo = "";
foreach ($_POST as $field => $value)
{
echo "<font color='white'>$field = $value<br></font>";
/* Notice the dot equals (.=) sign which appends data to a variable.
* With this, we don't need to add it again to the end of the statement. */
$datainfo .= $field => $value . "<br>";
}