Consider making your form fields an array, ONE way to do it is instead of :
name="form" . "$i";
Use the following :
name="form[]"
In otherwords :
<form action="foo.php" ...>
...
<input type="text" name="form[]"> // is automatically $form[0]
<input type="text" name="form[]"> // is automatically $form[1]
<input type="text" name="form[]"> // is automatically $form[2]
By "automatically form[0]" I mean PHP will interpet the form name as such. Top to bottom, starting at 0. Does this make sense? So :
print $form[0] will print the value of the form input from the first name="form[]" . Using arrays like this makes it nice because arrays are fun to play with. Let's say you wanted to print all your form values, one can do this :
foreach ($form as $key => $value) {
print "<br>$key => $value \n";
}
Pretty easy. Also, HTTP_POST_VARS and HTTP_GET_VARS exist and are nice to use too, consider them as well but that's not what we're talking about :-) The above advice should make this task easier. Hopefully.
Also, realize that one can name the form element keys too, like :
name="form[name]"
name="form[email]"
name="form[url]"
Yes I'm digressing here but it's important to know other options exist, the above are fairly common ones and much more useful then youre current route. Regarding your current problem, it may indirectly be a concate string issue, consider reading and printing out this tutorial :
http://www.zend.com/zend/tut/using-strings.php
Good luck!
Philip Olson