I am trying to make a dynamically sized form for a web-page I am creating! I have had no issue passing the information needed to the 'action' page through a form (including two arrays), by setting the name of all dynamically created forms to be name[i].
To get the data from the array in the 'action' file, I use the code below, and it works fine:
$_POST['name'][$i]
However, I wish to return the information to the form if there is an error with any of it, and the way I am doing this is with headers.
header("Location: ../originalPage.php?error=error&someValue=".$someValue."&someArray[]=".$someArray);
exit();
Is there anything I need to change for this to return something other than Array()?
Clearly the header is using the $_GET method rather than the form's $_POST method, but why can I only send the array one way?!
Any help would be appreciated!
$someArrayis itself an array? You can not concatenate arrays into strings like that, that will always only result in the word “Array”. You would need to access and append the individual, scalar values one by one.$someArrayis itself an array, and I wish to place this into the header as a single parameter, just like I did with the form to begin with. If the only way to do that is to append them individually, that's fine, I was just hoping there may be another way! Thanks for the help already though!