Jump to content

[SOLVED] dynamic name $_POST


bobohob

Recommended Posts

just a thought, if you don't care about order make it an array
i.e
page 1
[code]
<?php
for ($i = 1; $i <= 10; $i++) {
   echo "<input type=\"text\" name=\"data[]\" value=\"\" />";
}
?>

page 2

<?php

if(is_array($_POST['data'])){

  foreach($_POST['data'] as $value){

        //work on the data

  }

}

?>

[/code]

 

save you a lot of hassle about caring about the array's size

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.