This way you can use things like foreach loops (to loop through all the id variables even if you don't know how many variables there are) and array functions that will do a lot of cool stuff.
-Steve
"Build a man a fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life."
Like Stevish says you should really use an array for this. For example, if you create your forms like so:
HTML Code:
<input type="text" name="id[]" value="this is id 1" /><input type="text" name="id[]" value="this is id 1" /><input type="text" name="id[]" value="this is id 1" />
Then you will receive post data as an array:
PHP Code:
echo $_POST['id'][0]; // this is id 1 echo $_POST['id'][1]; // this is id 2
I don't see why you would need to create a whole new set of variables when the data is already there in the post array. What purpose does copying all the data serve?
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
the var is
Like Stevish says you should really use an array for this. For example, if you create your forms like so:
HTML Code:
<input type="text" name="id[]" value="this is id 1" /><input type="text" name="id[]" value="this is id 1" /><input type="text" name="id[]" value="this is id 1" />
Then you will receive post data as an array:
PHP Code:
echo $_POST['id'][0]; // this is id 1
echo $_POST['id'][1]; // this is id 2
I don't see why you would need to create a whole new set of variables when the data is already there in the post array. What purpose does copying all the data serve?
Bookmarks