dagon is right - using arrays is a much better way of doing what you want. For example, you could output the fields using square brackets so that PHP parses them as an array, e.g.:
<p>Name #1: <input type="text" name="name[0]"><br>
Type #1: <input type="text" name="type[0]"></p>
<p>Name #2: <input type="text" name="name[1]"><br>
Type #2: <input type="text" name="type[1]"></p>
Then, in your processing script, you'd handle the elements as arrays, e.g.:
for($i = 0; $i < count($_POST['name']); $i++) {
// data for current group can be accessed via:
echo "Name: " . $_POST['name'][$i] . ", Type: " . $_POST['type'][$i] . "<br>";
}