Jump to content

retrieving record from looped ('by php') field names


cyber_ghost

Recommended Posts

is there anybody here... already tried to retrieved datas from looped field names ....... looped field names are looped by php (for or while) after submitting the form.

 

like this looped field names :

 

.-------------------------------------  add.php

<?php

   

  for($loop=0;$loop<=10;$loop++)

      { 

      ?>

          <input type='text' name='<?php echo "good_".$loop ; ?>'  value='<?php echo "value".$loop; ?>'>

<?php

      }

?>

 

... html code here

 

------------------------------------------- add.php

 

 

is this right?

------------------------------------------- received.php

 

for($loop=0;$loop<=10;$loop++)

  {

      // field names (looped)

          $names = ${'good'.$loop};

 

echo $_POST[$names];

}

 

 

------------------------------------------ received.php

 

any help is appreciated....

 

 

Maybe I haven't had my coffee yet but your code didn't make alot of sense.  What is looped field names?  Most people just use the standard $_GET, $_POST, $_REQUEST...  I've never have ran into an occasion to do what you are saying.

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.