You have 1 flaw in your logic...
Quote:
|
A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
|
So, you r $$currentNumber is invalid, as it tries to create a variable $1, $2, $3...
Try to replace them with letters, rather than numbers, or create an 2 dimension array:
PHP Code:
$ary[$currentNumber]=array($name=>$val);
I don't exactly get what you want to achieve here, but just 1 tip about forms and arrays.
If you name your input fileds with an [] at the end, every fields that have the same name will be an array in the post values
example;
HTML Code:
<form name="frmxxx" action="" method="post">
<input type="text" name="myInp[]" value="one"/>
<input type="text" name="myInp[]" value="two"/>
<input type="text" name="myInp[]" value="three"/>
<input type="text" name="myInp[]" value="four"/>
</form>
This will result by an array named $myInp in thepost, that will hold all the values you are looking for.
And just for the beauty of the gesture (hrm...:shame: )
PHP Code:
$currentNumber = substr($name, (strpos($name, "_")+1));
This can be written with:
PHP Code:
list($junk,$currentNumber)=explode("_",$name);
Numerous strpos() can be rather heavy on the system, and that can do a difference on a busy server, but otherwise, it's just my 2 cents.