I have a form in which users enter an unlimited number of rows of data. They come to the form by entering any number of lines on the screen that they desire.
<?php $numRows = $_GET['NUM_ROWS_REQUESTED']; ?> <form method="post"> <?php for($i = 0; $i < $numRows ;$i++) { $uuid = uniqid(); ?> <input type="text" name="MYDATA[<?php print $uuid; ?>][FIRST_NAME]" /> <input type="text" name="MYDATA[<?php print $uuid; ?>][LAST_NAME]" /> <?php } ?> </form>
I am wondering if, after publishing the form, I get these entries in the $_POST['MYDATA'] , if I can be guaranteed that they will be ordered in the same sequence as on the screen. Or will they be ordered using uniqid() , which is randomly generated?
The reason why I use a unique identifier instead of integers, which will be easier to arrange, is because users can delete lines and add extra lines using javascript on this page. It would be too difficult to check for collisions.
html php html-form
aw crud Dec 09 '10 at 16:37 2010-12-09 16:37
source share