Reputation: 31
<input name="auth[]" type="text" id=" " value="<?php echo $cite_aut[$i]; ?>">
Above are text fields in html. Now how to get text fields values in a array variable in another php page.
I tried it by using foreach loop (foreach($val as $_POST['author']
)... but it fetch 1 extra value for $val, if there are 5 text boxes then it is fetching 6 values, 6th value is "array".
can someone explain how to do it?
Upvotes: 0
Views: 463
Reputation: 100175
Should be:
foreach($_POST['auth'] as $key => $val) {
......
}
Upvotes: 4