PhpTim Posted July 15, 2007 Share Posted July 15, 2007 Hi Everyone, I appreciate the time that you dedicate to my problem. I am working with a form <form name="form" ... etc When I submit the form it produces a form collection. which can be used via $_POST['<name of field>'] but what I am looking for is when I submit the form I get an array or list of the form fields. Does anyone know how to do this? I tried $var1 = $_POST; for($i = 0 ; $i < $var1; $i++) { echo "FieldName $i = ".$var1[$i]."<br />"; } with little results. Link to comment https://forums.phpfreaks.com/topic/60091-solved-need-to-gather-form-collection-names/ Share on other sites More sharing options...
pocobueno1388 Posted July 15, 2007 Share Posted July 15, 2007 <?php foreach ($_POST as $key => $val){ echo $key.' - '.$val.'<br>'; } EDIT: You can also view them like this: <?php echo '<pre>'; print_r($_POST); echo '</pre>'; ?> Link to comment https://forums.phpfreaks.com/topic/60091-solved-need-to-gather-form-collection-names/#findComment-298880 Share on other sites More sharing options...
PhpTim Posted July 15, 2007 Author Share Posted July 15, 2007 Thank you very much ... tested it ... works ... TOPIC SOLVED Link to comment https://forums.phpfreaks.com/topic/60091-solved-need-to-gather-form-collection-names/#findComment-298882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.