My web hosting has got register_globals turned off. In order to activate or initialize the array Page[] below I am putting "$Page = $_POST['Page'];" on Page2.php.
My question is: Is the $_POST['Page'] method the right way to initialize an array?
I know that the $_POST[''] method is the right way (or one of the right ways) for a variable. I just want to make sure that I'm doing it the right way for an array variable.
// Page1.php
<form method="post" action="Page2.php>
<input type="checkbox" name="Page[]" value="0">
<input type="checkbox" name="Page[]" value="1">
<input type="checkbox" name="Page[]" value="2">
<input type="checkbox" name="Page[]" value="3">
<input type="checkbox" name="Page[]" value="4">
</form>
The code below processes the input data on Page1.php above:
// Page2.php
// Is this the right way to declare the variable.
$Page = $_POST['Page'];
// I'm using a foreach loop here to process the Page[] array values.
Thanks.