I have a script in which I take a whole lot of data from a number of pages of a form, compile it into one, and let the user edit it before it's eventually thrown into a SQL database. The data coming from the forms is in post, and I've created arrays of all of the fields in the form, like:
$arr_page1 = array("firstname","middlename","lastname");
Then, I should be able to loop through the array to convert each of those from post to session variables, like
foreach($arr_page1 as $this) {
$_SESSION["$this"] = $_POST["$this"];
}
Is there a better way of doing it this way? This seems finicky (I always end up playing with it to get the quotes right... at the moment, it's not working).
Any ideas?